The Virtual Brain Project

Table Of Contents

Previous topic

base Package

Next topic

parser Package

This Page

model Package

@author: Gautham Ganapathy @organization: LEMS (http://neuroml.org/lems/, https://github.com/organizations/LEMS) @contact: gautham@lisphacker.org

component

Parameter, ComponentType and Component class definitions.

@author: Gautham Ganapathy @organization: LEMS (http://neuroml.org/lems/, https://github.com/organizations/LEMS) @contact: gautham@lisphacker.org

class tvb.dsl_cuda.lems.model.component.Attachments(name, type_, description='')[source]

Bases: lems.base.base.LEMSBase

Stores an attachment type specification.

description = None

Description about the attachment. @type: str

name = None

Name of the attachment collection. @type: str

toxml()[source]

Exports this object into a LEMS XML object

type = None

Type of attachment. @type: str

class tvb.dsl_cuda.lems.model.component.Children(name, type_, multiple=False)[source]

Bases: lems.base.base.LEMSBase

Stores children specification.

multiple = None

Single child / multiple children. @type: bool

name = None

Name of the children. @type: str

toxml()[source]

Exports this object into a LEMS XML object

type = None

Component type of the children. @type: str

class tvb.dsl_cuda.lems.model.component.Component(id_, type_, **params)[source]

Bases: lems.base.base.LEMSBase

Stores a component instantiation.

add(child)[source]

Adds a typed child object to the component.

@param child: Child object to be added.

add_child(child)[source]

Adds a child component.

@param child: Child component to be added. @type child: lems.model.component.Component

children = None

List of child components. @type: list(lems.model.component.Component)

id = None

ID of the component. @type: str

parameters = None

Dictionary of parameter values. @type: str

parent_id = None

Optional id of parent @type: str

set_parameter(parameter, value)[source]

Set a parameter.

@param parameter: Parameter to be set. @type parameter: str

@param value: Value to be set to. @type value: str

set_parent_id(parent_id)[source]

Sets the id of the parent Component

@param parent_id: id of the parent Component @type parent_id: str

toxml()[source]

Exports this object into a LEMS XML object

type = None

Type of the component. @type: str

class tvb.dsl_cuda.lems.model.component.ComponentReference(name, type_, local=None)[source]

Bases: lems.base.base.LEMSBase

Stores a component reference.

local = None

??? @type: str

name = None

Name of the component reference. @type: str

referenced_component = None

Component being referenced. @type: FatComponent

toxml()[source]

Exports this object into a LEMS XML object

type = None

Type of the component reference. @type: str

class tvb.dsl_cuda.lems.model.component.ComponentRequirement(name, description='')[source]

Bases: lems.base.base.LEMSBase

Specifies a component that is required

description = None

Description of this ComponentRequirement. @type: str

name = None

Name of the Component required. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.component.ComponentType(name, description='', extends=None)[source]

Bases: tvb.dsl_cuda.lems.model.component.Fat

Stores a component type declaration.

description = None

Description of this component type. @type: str

extends = None

Base component type. @type: str

name = None

Name of the component type. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.component.Constant(name, default, domain=None, symbol=None, description='')[source]

Bases: lems.base.base.LEMSBase

Stores a constant specification.

default = None

Value of the constant. @type: str

description = None

Description of the constant. @type: str

domain = None

Physical dimensions of the constant. @type: str

name = None

Name of the constant. @type: str

numeric_value = None

Numeric value of the constant. @type: float

symbol = None

Symbol of the constant. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.component.DerivedParameter(name, value, expression=None, description='')[source]

Bases: lems.base.base.LEMSBase

Store the specification of a derived parameter.

description = None

Description of the derived parameter. @type: str

expression = None

Physical dimensions of the derived parameter. @type: str

name = None

Name of the derived parameter. @type: str

toxml()[source]

Exports this object into a LEMS XML object

value = None

Value of the derived parameter. @type: str

class tvb.dsl_cuda.lems.model.component.EventPort(name, direction, description='')[source]

Bases: lems.base.base.LEMSBase

Stores an event port specification.

description = None

Description of the event port. @type: str

direction = None

Direction - IN/OUT . @type: str

name = None

Name of the event port. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.component.Exposure(name, choices, default, description='')[source]

Bases: lems.base.base.LEMSBase

Stores a exposure specification.

choices = None

Choices of the exposure. @type: str

default = None

Default option of the exposure. @type: str

description = None

Description of this exposure. @type: str

name = None

Name of the exposure. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.component.Fat[source]

Bases: lems.base.base.LEMSBase

Stores common elements for a component type / fat component.

add(child)[source]

Adds a typed child object to the component type.

@param child: Child object to be added.

add_attachments(attachments)[source]

Adds an attachments type specification to this component type.

@param attachments: Attachments specification to be added. @type attachments: lems.model.component.Attachments

add_children(children)[source]

Adds children to this component type.

@param children: Children to be added. @type children: lems.model.component.Children

add_component_reference(component_reference)[source]

Adds a component reference to this component type.

@param component_reference: Component reference to be added. @type component_reference: lems.model.component.ComponentReference

add_component_requirement(component_requirement)[source]

Adds a component requirement to this component type.

@param component_requirement: ComponentRequirement to be added. @type component_requirement: lems.model.component.ComponentRequirement

add_constant(constant)[source]

Adds a paramter to this component type.

@param constant: Constant to be added. @type constant: lems.model.component.Constant

add_derived_parameter(derived_parameter)[source]

Adds a derived_parameter to this component type.

@param derived_parameter: Derived Parameter to be added. @type derived_parameter: lems.model.component.DerivedParameter

add_event_port(event_port)[source]

Adds a event port to this component type.

@param event_port: Event port to be added. @type event_port: lems.model.component.EventPort

add_exposure(exposure)[source]

Adds a exposure to this component type.

@param exposure: Exposure to be added. @type exposure: lems.model.component.Exposure

add_function(function)[source]

Adds a paramter to this component type.

@param constant: Constant to be added. @type constant: lems.model.component.Constant

add_index_parameter(index_parameter)[source]

Adds an index_parameter to this component type.

@param index_parameter: Index Parameter to be added. @type index_parameter: lems.model.component.IndexParameter

add_instance_requirement(instance_requirement)[source]

Adds an instance requirement to this component type.

@param instance_requirement: InstanceRequirement to be added. @type instance_requirement: lems.model.component.InstanceRequirement

Adds a link to this component type.

@param link: Link to be added. @type link: lems.model.component.Link

add_parameter(parameter)[source]

Adds a paramter to this component type.

@param parameter: Parameter to be added. @type parameter: lems.model.component.Parameter

add_path(path)[source]

Adds a path to this component type.

@param path: Path to be added. @type path: lems.model.component.Path

add_property(property)[source]

Adds a property to this component type.

@param property: Property to be added. @type property: lems.model.component.Property

add_requirement(requirement)[source]

Adds a requirement to this component type.

@param requirement: Requirement to be added. @type requirement: lems.model.component.Requirement

add_text(text)[source]

Adds a text to this component type.

@param text: Text to be added. @type text: lems.model.component.Text

attachments = None

Map of attachment type specifications. @type: Map(str -> lems.model.component.Attachments)

children = None

Map of children. @type: Map(str -> lems.model.component.Children)

component_references = None

Map of component references. @type: Map(str -> lems.model.component.ComponentReference)

component_requirements = None

Map of component requirements. @type: Map(str -> lems.model.component.ComponentRequirement)

constants = None

Map of constants in this component type. @type: Map(str -> lems.model.component.Constant)

derived_parameters = None

Map of derived_parameters in this component type. @type: Map(str -> lems.model.component.Parameter)

dynamics = None

Behavioural dynamics object. @type: lems.model.dynamics.Dynamics

event_ports = None

Map of event ports. @type: Map(str -> lems.model.component.EventPort

exposures = None

Map of exposures in this component type. @type: Map(str -> lems.model.component.Exposure)

index_parameters = None

Map of index_parameters in this component type. @type: Map(str -> lems.model.component.IndexParameter)

instance_requirements = None

Map of instance requirements. @type: Map(str -> lems.model.component.InstanceRequirement)

Map of links. @type: Map(str -> lems.model.component.Link)

parameters = None

Map of parameters in this component type. @type: Map(str -> lems.model.component.Parameter)

paths = None

Map of path entries. @type: Map(str -> lems.model.component.Path)

properties = None

Map of properties in this component type. @type: Map(str -> lems.model.component.Property)

requirements = None

Map of requirements. @type: Map(str -> lems.model.component.Requirement)

simulation = None

Simulation attributes. @type: lems.model.simulation.Simulation

structure = None

Structural properties object. @type: lems.model.structure.Structure

texts = None

Map of text entries. @type: Map(str -> lems.model.component.Text)

types = None

Set of compatible component types. @type: set(str)

class tvb.dsl_cuda.lems.model.component.FatComponent(id_, type_)[source]

Bases: tvb.dsl_cuda.lems.model.component.Fat

Stores a resolved component.

add(child)[source]

Adds a typed child object to the component type.

@param child: Child object to be added.

add_child_component(child_component)[source]

Adds a child component to this fat component.

@param child_component: Child component to be added. @type child_component: lems.model.component.FatComponent

child_components = None

List of child components. @type: lems.model.component.FatComponent

id = None

ID of the component. @type: str

parent_id = None

Optional id of parent @type: str

set_parent_id(parent_id)[source]

Sets the id of the parent Component

@param parent_id: id of the parent Component @type parent_id: str

type = None

Type of the component. @type: str

class tvb.dsl_cuda.lems.model.component.Fixed(parameter, value, description='')[source]

Bases: tvb.dsl_cuda.lems.model.component.Parameter

Stores a fixed parameter specification.

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.component.Function(name, value, dimension=None, symbol=None, description='')[source]

Bases: lems.base.base.LEMSBase

Stores a constant specification.

description = None

Description of the constant. @type: str

dimension = None

Physical dimensions of the constant. @type: str

name = None

Name of the constant. @type: str

numeric_value = None

Numeric value of the constant. @type: float

symbol = None

Symbol of the constant. @type: str

toxml()[source]

Exports this object into a LEMS XML object

value = None

Value of the constant. @type: str

class tvb.dsl_cuda.lems.model.component.IndexParameter(name, description='')[source]

Bases: lems.base.base.LEMSBase

Stores a parameter which is an index (integer > 0).

description = None

Description of this parameter. @type: str

name = None

Name of the parameter. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.component.InstanceRequirement(name, type, description='')[source]

Bases: lems.base.base.LEMSBase

Stores an instance requirement specification.

description = None

Description of this InstanceRequirement. @type: str

name = None

Name of the instance requirement. @type: str

toxml()[source]

Exports this object into a LEMS XML object

type = None

Type of the instance required. @type: str

Bases: lems.base.base.LEMSBase

Stores a link specification.

description = None

Description of the link. @type: str

name = None

Name of the link entry. @type: str

toxml()[source]

Exports this object into a LEMS XML object

type = None

Type of the link. @type: str

value = None

Value of the link. @type: str

class tvb.dsl_cuda.lems.model.component.Parameter(name, dimension, description='')[source]

Bases: lems.base.base.LEMSBase

Stores a parameter declaration.

description = None

Description of this parameter. @type: str

dimension = None

Physical dimension of the parameter. @type: str

fixed = None

Whether the parameter has been fixed or not. @type: bool

fixed_value = None

Value if fixed. @type: str

name = None

Name of the parameter. @type: str

numeric_value = None

Resolved numeric value. @type: float

toxml()[source]

Exports this object into a LEMS XML object

value = None

Value of the parameter. @type: str

class tvb.dsl_cuda.lems.model.component.Path(name, description='')[source]

Bases: lems.base.base.LEMSBase

Stores a path entry specification.

description = None

Description of the path entry. @type: str

name = None

Name of the path entry. @type: str

toxml()[source]

Exports this object into a LEMS XML object

value = None

Value of the path entry. @type: str

class tvb.dsl_cuda.lems.model.component.Property(name, dimension=None, default_value=None, description='')[source]

Bases: lems.base.base.LEMSBase

Store the specification of a property.

default_value = None

Default value of the property. @type: float

description = None

Description of the property. @type: str

dimension = None

Physical dimensions of the property. @type: str

name = None

Name of the property. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.component.Requirement(name, dimension, description='')[source]

Bases: lems.base.base.LEMSBase

Stores a requirement specification.

description = None

Description of this requirement. @type: str

dimension = None

Physical dimension of the requirement. @type: str

name = None

Name of the requirement. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.component.Text(name, description='')[source]

Bases: lems.base.base.LEMSBase

Stores a text entry specification.

description = None

Description of the text entry. @type: str

name = None

Name of the text entry. @type: str

toxml()[source]

Exports this object into a LEMS XML object

value = None

Value of the text entry. @type: str

dynamics

Behavioral dynamics of component types.

@author: Gautham Ganapathy @organization: LEMS (http://neuroml.org/lems/, https://github.com/organizations/LEMS) @contact: gautham@lisphacker.org

MAvdVlag: altered attributes for state_variables, derived_variables, time_derivatives and conditional_derived_variable.

class tvb.dsl_cuda.lems.model.dynamics.Action[source]

Bases: lems.base.base.LEMSBase

Base class for event handler actions.

class tvb.dsl_cuda.lems.model.dynamics.Behavioral[source]

Bases: lems.base.base.LEMSBase

Store dynamic behavioral attributes.

add(child)[source]

Adds a typed child object to the behavioral object.

@param child: Child object to be added.

add_conditional_derived_variable(cdv)[source]

Adds a conditional derived variable to this behavior regime.

@param cdv: Conditional Derived variable. @type cdv: lems.model.dynamics.ConditionalDerivedVariable

add_derived_variable(dv)[source]

Adds a derived variable to this behavior regime.

@param dv: Derived variable. @type dv: lems.model.dynamics.DerivedVariable

add_event_handler(eh)[source]

Adds an event handler to this behavior regime.

@param eh: Event handler. @type eh: lems.model.dynamics.EventHandler

add_kinetic_scheme(ks)[source]

Adds a kinetic scheme to this behavior regime.

@param ks: Kinetic scheme. @type ks: lems.model.dynamics.KineticScheme

add_state_variable(sv)[source]

Adds a state variable to this behavior regime.

@param sv: State variable. @type sv: lems.model.dynamics.StateVariable

add_time_derivative(td)[source]

Adds a time derivative to this behavior regime.

@param td: Time derivative. @type td: lems.model.dynamics.TimeDerivative

clear()[source]

Clear behavioral entities.

conditional_derived_variables = None

Map of conditional derived variables in this behavior regime. @type: dict(str -> lems.model.dynamics.ConditionalDerivedVariable

derived_variables = None

Map of derived variables in this behavior regime. @type: dict(str -> lems.model.dynamics.DerivedVariable

event_handlers = None

List of event handlers in this behavior regime. @type: list(lems.model.dynamics.EventHandler)

has_content()[source]
kinetic_schemes = None

Map of kinetic schemes in this behavior regime. @type: dict(str -> lems.model.dynamics.KineticScheme)

parent_behavioral = None

Parent behavioral object. @type: lems.model.dynamics.Behavioral

state_variables = None

Map of state variables in this behavior regime. @type: dict(str -> lems.model.dynamics.StateVariable

time_derivatives = None

Map of time derivatives in this behavior regime. @type: dict(str -> lems.model.dynamics.TimeDerivative)

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.dynamics.Case(condition, value)[source]

Bases: lems.base.base.LEMSBase

Store the specification of a case for a Conditional Derived Variable.

condition = None

Condition for this case. @type: str

condition_expression_tree = None

Parse tree for the case condition expression. @type: lems.parser.expr.ExprNode

toxml()[source]

Exports this object into a LEMS XML object

value = None

Value if the condition is true. @type: str

value_expression_tree = None

Parse tree for the case condition expression. @type: lems.parser.expr.ExprNode

class tvb.dsl_cuda.lems.model.dynamics.ConditionalDerivedVariable(name, condition, exposure=None, cases=None)[source]

Bases: lems.base.base.LEMSBase

Store the specification of a conditional derived variable.

add(child)[source]

Adds a typed child object to the conditional derived variable.

@param child: Child object to be added.

add_case(case)[source]

Adds a case to this conditional derived variable.

@param case: Case to be added. @type case: lems.model.dynamics.Case

cases = None

List of cases related to this conditional derived variable. @type: list(lems.model.dynamics.Case)

condition = None

Dimension of the state variable. @type: str

exposure = None

Exposure name for the state variable. @type: str

name = None

Name of the derived variable. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.dynamics.DerivedVariable(name, **params)[source]

Bases: lems.base.base.LEMSBase

Store the specification of a derived variable.

dimension = None

Dimension of the derived variable or None if computed. @type: str

exposure = None

Exposure name for the derived variable. @type: str

expression = None

Value of the derived variable. @type: str

expression_tree = None

Parse tree for the time derivative expression. @type: lems.parser.expr.ExprNode

name = None

Name of the derived variable. @type: str

reduce = None

Reduce method for the derived variable. @type: str

required = None

Requried or not. @type: str

select = None

Selection path/expression for the derived variable. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.dynamics.Dynamics[source]

Bases: tvb.dsl_cuda.lems.model.dynamics.Behavioral

Stores behavioral dynamics specification for a component type.

add(child)[source]

Adds a typed child object to the dynamics object.

@param child: Child object to be added.

add_regime(regime)[source]

Adds a behavior regime to this dynamics object.

@param regime: Behavior regime to be added. @type regime: lems.model.dynamics.Regime

has_content()[source]
regimes = None

Map of behavior regimes. @type: Map(str -> lems.model.dynamics.Regime)

class tvb.dsl_cuda.lems.model.dynamics.EventHandler[source]

Bases: lems.base.base.LEMSBase

Base class for event handlers.

actions = None

List of actions to be performed in response to this event. @type: list(lems.model.dynamics.Action)

add(child)[source]

Adds a typed child object to the event handler.

@param child: Child object to be added.

add_action(action)[source]

Adds an action to this event handler.

@param action: Action to be added. @type action: lems.model.dynamics.Action

class tvb.dsl_cuda.lems.model.dynamics.EventOut(port)[source]

Bases: tvb.dsl_cuda.lems.model.dynamics.Action

Event transmission specification.

port = None

Port on which the event comes in. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.dynamics.KineticScheme(name, nodes, state_variable, edges, edge_source, edge_target, forward_rate, reverse_rate)[source]

Bases: lems.base.base.LEMSBase

Kinetic scheme specifications.

edge_source = None

Attribute that defines the source of the transition. @type: str

edge_target = None

Attribute that defines the target of the transition. @type: str

edges = None

Edges to be used for the kinetic scheme. @type: str

forward_rate = None

Name of the forward rate exposure. @type: str

name = None

Name of the kinetic scheme. @type: str

nodes = None

Nodes to be used for the kinetic scheme. @type: str

reverse_rate = None

Name of the reverse rate exposure. @type: str

state_variable = None

State variable updated by the kinetic scheme. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.dynamics.OnCondition(test)[source]

Bases: tvb.dsl_cuda.lems.model.dynamics.EventHandler

Specification for event handler called upon satisfying a given condition.

test = None

Condition to be tested for. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.dynamics.OnEntry[source]

Bases: tvb.dsl_cuda.lems.model.dynamics.EventHandler

Specification for event handler called upon entry into a new behavior regime.

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.dynamics.OnEvent(port)[source]

Bases: tvb.dsl_cuda.lems.model.dynamics.EventHandler

Specification for event handler called upon receiving en event sent by another component.

port = None

Port on which the event comes in. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.dynamics.OnStart[source]

Bases: tvb.dsl_cuda.lems.model.dynamics.EventHandler

Specification for event handler called upon initialization of the component.

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.dynamics.Regime(name, parent_behavioral, initial=False)[source]

Bases: tvb.dsl_cuda.lems.model.dynamics.Behavioral

Stores a single behavioral regime for a component type.

initial = None

Initial behavior regime. @type: bool

name = None

Name of this behavior regime. @type: str

parent_behavioral = None

Parent behavioral object. @type: lems.model.dynamics.Behavioral

class tvb.dsl_cuda.lems.model.dynamics.StateAssignment(variable, value)[source]

Bases: tvb.dsl_cuda.lems.model.dynamics.Action

State assignment specification.

expression_tree = None

Parse tree for the time derivative expression. @type: lems.parser.expr.ExprNode

toxml()[source]

Exports this object into a LEMS XML object

value = None

Derivative expression. @type: str

variable = None

Name of the variable for which the time derivative is being specified. @type: str

class tvb.dsl_cuda.lems.model.dynamics.StateVariable(name, default, boundaries=None)[source]

Bases: lems.base.base.LEMSBase

Store the specification of a state variable.

boundaries = None

Boundaries name for the state variable. @type: str

default = None

Default of the state variable. @type: str

name = None

Name of the state variable. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.dynamics.TimeDerivative(name, expression)[source]

Bases: lems.base.base.LEMSBase

Store the specification of a time derivative specifcation.

expression = None

Derivative expression. @type: str

expression_tree = None

Parse tree for the time derivative expression. @type: lems.parser.expr.ExprNode

name = None

Name of the variable for which the time derivative is being specified. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.dynamics.Transition(regime)[source]

Bases: tvb.dsl_cuda.lems.model.dynamics.Action

Regime transition specification.

regime = None

Regime to transition to. @type: str

toxml()[source]

Exports this object into a LEMS XML object

fundamental

Dimension and Unit definitions in terms of the fundamental SI units.

@author: Gautham Ganapathy @organization: LEMS (http://neuroml.org/lems/, https://github.com/organizations/LEMS) @contact: gautham@lisphacker.org

class tvb.dsl_cuda.lems.model.fundamental.Dimension(name, description='', **params)[source]

Bases: lems.base.base.LEMSBase

Stores a dimension in terms of the seven fundamental SI units.

description = None

Description of this dimension. @type: str

i = None

Power for the electic current dimension. @type: int

j = None

Power for the luminous intensity dimension. @type: int

k = None

Power for the temperature dimension. @type: int

l = None

Power for the length dimension. @type: int

m = None

Power for the mass dimension. @type: int

n = None

Power for the quantity dimension. @type: int

name = None

Name of the dimension. @type: str

t = None

Power for the time dimension. @type: int

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.fundamental.Include(filename)[source]

Bases: lems.base.base.LEMSBase

Include another LEMS file.

file = None

Name of the file. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.fundamental.Unit(name, symbol, dimension, power=0, scale=1.0, offset=0.0, description='')[source]

Bases: lems.base.base.LEMSBase

Stores a unit definition.

description = None

Description of this unit. @type: str

dimension = None

Dimension for the unit. @type: str

name = None

Name of the unit. @type: str

offset = None

Offset for non-zero units. @type: float

power = None

Scaling by power of 10. @type: int

scale = None

Scaling. @type: float

symbol = None

Symbol for the unit. @type: str

toxml()[source]

Exports this object into a LEMS XML object

model

Model storage.

@author: Gautham Ganapathy @organization: LEMS (http://neuroml.org/lems/, https://github.com/organizations/LEMS) @contact: gautham@lisphacker.org

class tvb.dsl_cuda.lems.model.model.Model(include_includes=True, fail_on_missing_includes=True)[source]

Bases: lems.base.base.LEMSBase

Stores a model.

add(child)[source]

Adds a typed child object to the model.

@param child: Child object to be added.

add_component(component)[source]

Adds a component to the model.

@param component: Component to be added. @type component: lems.model.fundamental.Component

add_component_type(component_type)[source]

Adds a component type to the model.

@param component_type: Component type to be added. @type component_type: lems.model.fundamental.ComponentType

add_constant(constant)[source]

Adds a paramter to the model.

@param constant: Constant to be added. @type constant: lems.model.component.Constant

add_dimension(dimension)[source]

Adds a dimension to the model.

@param dimension: Dimension to be added. @type dimension: lems.model.fundamental.Dimension

add_fat_component(fat_component)[source]

Adds a fattened component to the model.

@param fat_component: Fattened component to be added. @type fat_component: lems.model.fundamental.Fat_component

add_include(include)[source]

Adds an include to the model.

@param include: Include to be added. @type include: lems.model.fundamental.Include

add_target(target)[source]

Adds a simulation target to the model.

@param target: Name of the component to be added as a simulation target. @type target: str

add_unit(unit)[source]

Adds a unit to the model.

@param unit: Unit to be added. @type unit: lems.model.fundamental.Unit

branch = 'development'
component_types = None

Map of component types defined in the model. @type: dict(str -> lems.model.component.ComponentType)

components = None

Map of root components defined in the model. @type: dict(str -> lems.model.component.Component)

constants = None

Map of constants in this component type. @type: dict(str -> lems.model.component.Constant)

debug = False
description = None

Short description of contents of LEMS file @type: str

dimensions = None

Dictionary of dimensions defined in the model. @type: dict(str -> lems.model.fundamental.Dimension

fail_on_missing_includes = None

Whether to raise an Exception when a file in an <Include> element is not found @type: boolean

fat_components = None

Map of root fattened components defined in the model. @type: dict(str -> lems.model.component.FatComponent)

fatten_component(c)[source]

Fatten a component but resolving all references into the corresponding component type.

@param c: Lean component to be fattened. @type c: lems.model.component.Component

@return: Fattened component. @rtype: lems.model.component.FatComponent

get_numeric_value(value_str, dimension=None)[source]

Get the numeric value for a parameter value specification.

@param value_str: Value string @type value_str: str

@param dimension: Dimension of the value @type dimension: str

get_parent_component(fc)[source]

TODO: Replace with more efficient way to do this...

import_from_file(filepath)[source]

Import a model from a file.

@param filepath: File to be imported. @type filepath: str

include_directories = None

List of include directories to search for included LEMS files. @type: list(str)

include_includes = None

Whether to include LEMS definitions in <Include> elements @type: boolean

included_files = None

List of files already included. @type: list(str)

includes = None

Dictionary of includes defined in the model. @type: dict(str -> lems.model.fundamental.Include

merge_component_types(ct, base_ct)[source]

Merge various maps in the given component type from a base component type.

@param ct: Component type to be resolved. @type ct: lems.model.component.ComponentType

@param base_ct: Component type to be resolved. @type base_ct: lems.model.component.ComponentType

resolve()[source]

Resolves references in this model.

resolve_component_type(component_type)[source]

Resolves references in the specified component type.

@param component_type: Component type to be resolved. @type component_type: lems.model.component.ComponentType

resolve_simulation(fc, ct)[source]

Resolve simulation specifications.

resolve_structure(fc, ct)[source]

Resolve structure specifications.

schema_location = 'https://raw.githubusercontent.com/LEMS/LEMS/development/Schemas/LEMS/LEMS_v0.7.3.xsd'
target_lems_version = '0.7.3'
targets = None

List of targets to be run on startup. @type: list(str)

units = None

Map of units defined in the model. @type: dict(str -> lems.model.fundamental.Unit

simulation

Simulation specification classes.

@author: Gautham Ganapathy @organization: LEMS (http://neuroml.org/lems/, https://github.com/organizations/LEMS) @contact: gautham@lisphacker.org

class tvb.dsl_cuda.lems.model.simulation.DataDisplay(title, data_region)[source]

Bases: tvb.dsl_cuda.lems.model.simulation.DataOutput

Stores specification for a data display.

data_region = None

Display position @type: string

time_scale = None

Time scale @type: Number

title = None

Title for the display. @type: string

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.simulation.DataOutput[source]

Bases: lems.base.base.LEMSBase

Generic data output specification class.

class tvb.dsl_cuda.lems.model.simulation.DataWriter(path, file_name)[source]

Bases: tvb.dsl_cuda.lems.model.simulation.DataOutput

Stores specification for a data writer.

file_name = None

Text parameter to be used for the file name @type: string

path = None

Path to the quantity to be saved to file. @type: string

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.simulation.EventRecord(quantity, eventPort)[source]

Bases: lems.base.base.LEMSBase

Stores the parameters of an <EventRecord> statement.

eventPort = None

eventPort to be used for the event record @type: str

id = None

Id of the quantity @type: str

quantity = None

Path to the quantity to be recorded. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.simulation.EventWriter(path, file_name, format)[source]

Bases: tvb.dsl_cuda.lems.model.simulation.DataOutput

Stores specification for an event writer.

file_name = None

Text parameter to be used for the file name @type: string

format = None

Text parameter to be used for the format @type: string

path = None

Path to the quantity to be saved to file. @type: string

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.simulation.Record(quantity, scale=None, color=None, id=None)[source]

Bases: lems.base.base.LEMSBase

Stores the parameters of a <Record> statement.

color = None

Text parameter to be used to specify the color for display. @type: str

id = None

Text parameter to be used to specify an id for the record @type: str

quantity = None

Path to the quantity to be recorded. @type: str

scale = None

Text parameter to be used for scaling the quantity before display. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.simulation.Run(component, variable, increment, total)[source]

Bases: lems.base.base.LEMSBase

Stores the description of an object to be run according to an independent variable (usually time).

component = None

Name of the target component to be run according to the specification given for an independent state variable. @type: str

increment = None

Increment of the state variable on each step. @type: str

total = None

Final value of the state variable. @type: str

toxml()[source]

Exports this object into a LEMS XML object

variable = None

The name of an independent state variable according to which the target component will be run. @type: str

class tvb.dsl_cuda.lems.model.simulation.Simulation[source]

Bases: lems.base.base.LEMSBase

Stores the simulation-related attributes of a component-type.

add(child)[source]

Adds a typed child object to the simulation spec.

@param child: Child object to be added.

add_data_display(data_display)[source]

Adds a data display to this simulation section.

@param data_display: Data display to be added. @type data_display: lems.model.simulation.DataDisplay

add_data_writer(data_writer)[source]

Adds a data writer to this simulation section.

@param data_writer: Data writer to be added. @type data_writer: lems.model.simulation.DataWriter

add_event_record(event_record)[source]

Adds an eventrecord object to the list of event_record objects in this dynamics regime.

@param event_record: EventRecord object to be added. @type event_record: lems.model.simulation.EventRecord

add_event_writer(event_writer)[source]

Adds an event writer to this simulation section.

@param event_writer: event writer to be added. @type event_writer: lems.model.simulation.EventWriter

add_record(record)[source]

Adds a record object to the list of record objects in this dynamics regime.

@param record: Record object to be added. @type record: lems.model.simulation.Record

add_run(run)[source]

Adds a runnable target component definition to the list of runnable components stored in this context.

@param run: Run specification @type run: lems.model.simulation.Run

data_displays = None

Map of data displays mapping titles to regions. @type: Map(string -> string)

data_writers = None

Map of recorded variables to data writers. @type: Map(string -> lems.model.simulation.DataWriter

event_records = None

Map of recorded events in this dynamics regime. @type: Map(string -> lems.model.simulation.EventRecord

event_writers = None

Map of recorded variables to event writers. @type: Map(string -> lems.model.simulation.EventWriter

records = None

Map of recorded variables in this dynamics regime. @type: Map(string -> lems.model.simulation.Record

runs = None

Map of runs in this dynamics regime. @type: Map(string -> lems.model.simulation.Run)

toxml()[source]

Exports this object into a LEMS XML object

structure

Structural properties of component types.

@author: Gautham Ganapathy @organization: LEMS (http://neuroml.org/lems/, https://github.com/organizations/LEMS) @contact: gautham@lisphacker.org

class tvb.dsl_cuda.lems.model.structure.Assign(property, value)[source]

Bases: lems.base.base.LEMSBase

Stores a child assign specification.

property_ = None

Name of the property reference to be used for instantiation. @type: str

toxml()[source]

Exports this object into a LEMS XML object

value = None

Value of the property. @type: str

class tvb.dsl_cuda.lems.model.structure.ChildInstance(component, referenced_component=None)[source]

Bases: lems.base.base.LEMSBase

Stores a child instantiation specification.

component = None

Name of the component reference to be used for instantiation. @type: str

referenced_component = None

Target component being referenced after resolution. @type: lems.model.component.FatComponent

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.structure.EventConnection(from_, to, source_port, target_port, receiver, receiver_container)[source]

Bases: lems.base.base.LEMSBase

Stores an event connection specification.

from_ = None

Name of the source component for event. @type: str

receiver = None

Name of the proxy receiver component attached to the target component that actually receiving the event. @type: str

receiver_container = None

Name of the child component grouping to add the receiver to. @type: str

source_port = None

Source port name. @type: str

target_port = None

Target port name. @type: str

to = None

Name of the target component for the event. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.structure.ForEach(instances, as_)[source]

Bases: lems.base.base.LEMSBase

ForEach specification.

add_event_connection(ec)[source]

Adds an event conenction to the structure.

@param ec: Event connection. @type ec: lems.model.structure.EventConnection

add_for_each(fe)[source]

Adds a for-each specification.

@param fe: For-each specification. @type fe: lems.model.structure.ForEach

event_connections = None

List of event connections. @type: list(lems.model.structure.EventConnection)

for_eachs = None

List of for each specs. @type: list(lems.model.structure.ForEach)

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.structure.MultiInstantiate(component=None, number=None, component_type=None)[source]

Bases: lems.base.base.LEMSBase

Stores a child multi-instantiation specification.

add(child)[source]

Adds a typed child object to the structure object.

@param child: Child object to be added.

add_assign(assign)[source]

Adds an Assign to the structure.

@param assign: Assign structure. @type assign: lems.model.structure.Assign

assignments = None

List of assignments included in MultiInstantiate. @type: list(Assign)

component = None

Name of the component reference to be used for instantiation. @type: str

component_type = None

Name of the component type reference to be used for instantiation. @type: str

number = None

Name of the paramter specifying the number of times the component reference is to be instantiated. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.structure.Structure[source]

Bases: lems.base.base.LEMSBase

Stores structural properties of a component type.

add(child)[source]

Adds a typed child object to the structure object.

@param child: Child object to be added.

add_child_instance(ci)[source]

Adds a child instantiation specification.

@param ci: Child instantiation specification. @type ci: lems.model.structure.ChildInstance

add_event_connection(ec)[source]

Adds an event conenction to the structure.

@param ec: Event connection. @type ec: lems.model.structure.EventConnection

add_for_each(fe)[source]

Adds a for-each specification.

@param fe: For-each specification. @type fe: lems.model.structure.ForEach

add_multi_instantiate(mi)[source]

Adds a child multi-instantiation specification.

@param mi: Child multi-instantiation specification. @type mi: lems.model.structure.MultiInstantiate

add_tunnel(tunnel)[source]

Adds a tunnel specification to the structure.

@param tunnel: tunnel specification. @type tunnel: lems.model.structure.Tunnel

add_with(with_)[source]

Adds a with-as specification to the structure.

@param with_: With-as specification. @type with_: lems.model.structure.With

child_instances = None

List of child instantations. @type: list(lems.model.structure.ChildInstance)

event_connections = None

List of event connections. @type: list(lems.model.structure.EventConnection)

for_eachs = None

List of for each specs. @type: list(lems.model.structure.ForEach)

has_content()[source]
multi_instantiates = None

List of child multi-instantiations. @type: list(lems.model.structure.MultiInstantiate)

toxml()[source]

Exports this object into a LEMS XML object

tunnels = None

Map of tunnel statements. @type: Map(str -> lems.model.structure.Tunnel)

withs = None

Map of With statements. @type: Map(str -> lems.model.structure.With)

class tvb.dsl_cuda.lems.model.structure.Tunnel(name, end_a, end_b, component_a, component_b)[source]

Bases: lems.base.base.LEMSBase

Stores a Tunnel.

component_a = None

Component to create at A. @type: str

component_b = None

Component to create at B. @type: str

end_a = None

‘A’ end of Tunnel. @type: str

end_b = None

‘B’ end of Tunnel. @type: str

name = None

name of Tunnel. @type: str

toxml()[source]

Exports this object into a LEMS XML object

class tvb.dsl_cuda.lems.model.structure.With(instance, as_, list=None, index=None)[source]

Bases: lems.base.base.LEMSBase

Stores a with-as statement.

as_ = None

Alternative name. @type: str

index = None

index in list to be referenced. @type: str

instance = None

Instance to be referenced. @type: str

list = None

list of components, e.g. population @type: str

toxml()[source]

Exports this object into a LEMS XML object