Bases: tvb.simulator.history.BaseHistory
Class for cosimulation history implementation. It stores the whole TVB state for the co-simulation synchronization time. The synchronization time has to be shorter than the maximum delay (it usually is equal to the minimum delay of coupling between the co-simulators). It is a DenseHistory since the whole state has to be stored for all delays.
Data descriptor for a NumPy array, with type, mutability and shape checking.
Initialize CosimHistory from the TVB history which is assumed already configured.
Specialization of Final to int/long type.
Specialization of Final to int/long type.
Specialization of Final to int/long type.
Specialization of Final to int/long type.
This method returns the whole TVB current_state by querying the CosimHistory state buffer for a time step.
This method will update the CosimHistory state buffer with the whole TVB state for a specific time step.
This method will update the CosimHistory state buffer from input from the other co-simulator, for - the state variables with indices vois, - the region nodes with indices proxy_inds, - and for the specified time steps.
Bases: tvb.simulator.monitors.AfferentCoupling, tvb.contrib.cosimulation.cosim_monitors.CosimMonitorFromCoupling
A monitor that records the future coupling of selected variables: It collects:
- selected coupling values and all modes from class :Model:
- all nodes of a region or surface based
- all the integration time steps
variables_of_interest : tvb.simulator.monitors.AfferentCoupling.variables_of_interest = NArray(label=’Indices of coupling variables to record’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
period : tvb.simulator.monitors.Raw.period = Float(field_type=<class ‘float’>, default=0.0, required=True)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
Bases: tvb.basic.neotraits._core.HasTraits
Abstract base class for cosimulation monitors implementations.
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
Bases: tvb.contrib.cosimulation.cosim_monitors.CosimMonitor
Abstract base class for a monitor that records the future coupling values.
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.
Bases: tvb.simulator.monitors.Raw, tvb.contrib.cosimulation.cosim_monitors.CosimMonitor
A monitor that records the output raw data from the partial (up to synchronization time) cosimulation history of TVB simulation. It collects:
- all state variables and modes from class :Model:
- all nodes of a region or surface based
- all the integration time steps
period : tvb.simulator.monitors.Raw.period = Float(field_type=<class ‘float’>, default=0.0, required=True)
variables_of_interest : tvb.simulator.monitors.Raw.variables_of_interest = NArray(label=’Raw Monitor sees all!!! Resistance is futile...’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
Bases: tvb.simulator.monitors.Raw, tvb.contrib.cosimulation.cosim_monitors.CosimMonitor
A monitor that records the output raw data of all coupling variables from the full history of a TVB simulation. It collects:
- all coupling state variables and modes from class :Model:
- all nodes of a region or surface based
- all the integration time steps
period : tvb.simulator.monitors.Raw.period = Float(field_type=<class ‘float’>, default=0.0, required=True)
variables_of_interest : tvb.simulator.monitors.Raw.variables_of_interest = NArray(label=’Raw Monitor sees all!!! Resistance is futile...’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
Bases: tvb.simulator.monitors.RawVoi, tvb.contrib.cosimulation.cosim_monitors.CosimMonitor
A monitor that records the output raw data of selected variables from the partial (up to synchronization time) history of TVB simulation. It collects:
- voi state variables and all modes from class :Model:
- all nodes of a region or surface based
- all the integration time steps
period : tvb.simulator.monitors.Raw.period = Float(field_type=<class ‘float’>, default=0.0, required=True)
variables_of_interest : tvb.simulator.monitors.Raw.variables_of_interest = NArray(label=’Raw Monitor sees all!!! Resistance is futile...’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
Bases: tvb.simulator.monitors.RawVoi, tvb.contrib.cosimulation.cosim_monitors.CosimMonitor
A monitor that records the output raw data of selected coupling variables from the full history of a TVB simulation. It collects:
- selected coupling state variables and all modes from class :Model:
- all nodes of a region or surface based
- all the integration time steps
period : tvb.simulator.monitors.Raw.period = Float(field_type=<class ‘float’>, default=0.0, required=True)
variables_of_interest : tvb.simulator.monitors.Raw.variables_of_interest = NArray(label=’Raw Monitor sees all!!! Resistance is futile...’, dtype=int64, default=None, dim_names=(), ndim=None, required=False)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
This is the module responsible for co-simulation of TVB with spiking simulators. It inherits the Simulator class. .. moduleauthor:: Lionel Kusch <lkusch@thevirtualbrain.org> .. moduleauthor:: Dionysios Perdikis <dionperd@gmail.com>
Bases: tvb.simulator.simulator.Simulator
proxy_inds : tvb.contrib.cosimulation.cosimulator.CoSimulator.proxy_inds = NArray(label=’Indices of TVB proxy nodes’, dtype=int64, default=array([], dtype=int64), dim_names=(), ndim=None, required=True)
cosim_monitors : tvb.contrib.cosimulation.cosimulator.CoSimulator.cosim_monitors = List(of=<class ‘tvb.contrib.cosimulation.cosim_monitors.CosimMonitor’>, default=(), required=True)
gid : tvb.basic.neotraits._core.HasTraits.gid = Attr(field_type=<class ‘uuid.UUID’>, default=None, required=True)
Configure simulator and its components.
The first step of configuration is to run the configure methods of all the Simulator’s components, ie its traited attributes.
Configuration of a Simulator primarily consists of calculating the attributes, etc, which depend on the combinations of the Simulator’s traited attributes (keyword args).
Converts delays from physical time units into integration steps and updates attributes that depend on combinations of the 6 inputs.
The attribute is a list of values. Choices and type are reinterpreted as applying not to the list but to the elements of it
An Attr declares the following about the attribute it describes: * the type * a default value shared by all instances * if the value might be missing * documentation It will resolve to attributes on the instance.
return the value of the cosimulator monitors :param n_steps=None: the number of steps, it defaults to CoSimulator.synchronization_n_step :param relative_start_step=0: the first step of the values,
the default value 0 corresponds to start_step = CoSimulator.current_step - CoSimulator.synchronization_n_step + 1 for non-coupling CosimMonitor, and to start_step = CoSimulator.current_step + 1 for coupling CosimMonitor, instances
Returns: | list of monitor outputs |
---|
Declares a numpy array. dtype enforces the dtype. The default dtype is float32. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.
Declares a float. This is different from Attr(field_type=float). The former enforces float subtypes. This allows any type that can be safely cast to the declared float type according to numpy rules.
Reading and writing this attribute is slower than a plain python attribute. In performance sensitive code you might want to use plain python attributes or even better local variables.
Declares a numpy array. dtype enforces the dtype. The default dtype is float32. An optional symbolic shape can be given, as a tuple of Dim attributes from the owning class. The shape will be enforced, but no broadcasting will be done. domain declares what values are allowed in this array. It can be any object that can be checked for membership Defaults are checked if they are in the declared domain. For performance reasons this does not happen on every attribute set.
This is special exception for the cosimulation .. moduleauthor:: Lionel Kusch <lkusch@thevirtualbrain.org> .. moduleauthor:: Dionysios Perdikis <dionperd@gmail.com>