def parameters_changed(self, dynamic_gid, params):
     with self.traj_lock:
         params = json.loads(params)
         dynamic = self.get_cached_dynamic(dynamic_gid)
         model = dynamic.model
         for name, value in params.iteritems():
             setattr(model, name, numpy.array([float(value)]))
         model.configure()
         return dynamic.phase_plane.compute_phase_plane()
Exemplo n.º 2
0
 def parameters_changed(self, dynamic_gid, params):
     with self.traj_lock:
         params = json.loads(params)
         dynamic = self.get_cached_dynamic(dynamic_gid)
         model = dynamic.model
         for name, value in params.iteritems():
             setattr(model, name, numpy.array([float(value)]))
         model.configure()
         return dynamic.phase_plane.compute_phase_plane()
    def __init__(self, model=None, integrator=None):
        if model is None:
            model = models.Generic2dOscillator()
        if integrator is None:
            integrator = integrators.HeunDeterministic()

        model.configure()
        self.model = model
        self.integrator = integrator

        # Only one instance should exist for a browser page.
        # To achieve something close to that we store it here
        self.phase_plane = phase_space_d3(model, integrator)
Exemplo n.º 4
0
    def __init__(self, model=None, integrator=None):
        if model is None:
            model = models.Generic2dOscillator()
        if integrator is None:
            integrator = integrators.HeunDeterministic()

        model.configure()
        self.model = model
        self.integrator = integrator

        # Only one instance should exist for a browser page.
        # To achieve something close to that we store it here
        self.phase_plane = phase_space_d3(model, integrator)