Ejemplo n.º 1
0
    def __init__(self,
                 simulation=None,
                 name=None,
                 does_require_simulation=True,
                 **kwargs):

        if does_require_simulation:
            assert simulation is not None

        if simulation is not None and not simulation in NamedSimulationObject._obj_names:
            NamedSimulationObject._obj_names[simulation] = set()

        if not name:
            name = ObjectLabeller.get_next_unamed_object_name(
                obj_type=NamedSimulationObject, prefix='AnonObj')

        if does_require_simulation:
            assert not name in NamedSimulationObject._obj_names[
                simulation], 'Duplicate name:%s' % name
            NamedSimulationObject._obj_names[simulation].add(name)

        self._name = name
        self._simulation = simulation

        super(NamedSimulationObject, self).__init__(**kwargs)
Ejemplo n.º 2
0
 def save_dot(cls, graph, format, **kwargs):
     from morphforge.core import ObjectLabeller
     name = ObjectLabeller.get_next_unamed_object_name(type(graph))
     tmp_dir = LocMgr.get_tmp_path()
     fname = '%s/dotout_%s.%s' % (tmp_dir, name, format)
     graph.write_pdf(fname, **kwargs)
     return fname
Ejemplo n.º 3
0
 def save_dot(cls, graph, format, **kwargs):
     from morphforge.core import ObjectLabeller
     name = ObjectLabeller.get_next_unamed_object_name(type(graph))
     tmp_dir = LocMgr.get_tmp_path()
     fname = '%s/dotout_%s.%s' % (tmp_dir, name, format)
     graph.write_pdf(fname, **kwargs)
     return fname
Ejemplo n.º 4
0
    def __init__(self, **kwargs):
        super(Neuron_NeuroUnitEqnsetMechanism, self).__init__(**kwargs)

        self.nmodl_txt, self.buildparameters = WriteToNMODL(
            self.eqnset,
            neuron_suffix="NRNEQNSET" +
            ObjectLabeller.get_next_unamed_object_name(
                Neuron_NeuroUnitEqnsetMechanism, prefix=""))

        assert self.buildparameters.mechanismtype == MechanismType.Distributed
        self.units = {}
        for (param_str, value) in self._parameters.iteritems():
            sym = self.eqnset.get_terminal_obj(param_str)
            param_default_unit = self.buildparameters.symbol_units[sym]
            self.units[param_str] = param_default_unit.as_quantities_unit()

        self.NRNSUFFIX = self.buildparameters.suffix
Ejemplo n.º 5
0
    def __init__(self, **kwargs):
        super(NEURONPostSynapticTemplate_NeuroUnitEquationSetPostSynaptic,
              self).__init__(**kwargs)

        self.is_mod_built = False

        self.nmodl_txt, self.buildparameters = WriteToNMODL(
            self.eqnset,
            neuron_suffix="NRNEQNSETSYN" +
            ObjectLabeller.get_next_unamed_object_name(type(self), prefix=""))

        assert self.buildparameters.mechanismtype == MechanismType.Point
        self.units = {}
        for (param_str, value) in self._default_parameters.iteritems():
            sym = self.eqnset.get_terminal_obj(param_str)
            param_default_unit = self.buildparameters.symbol_units[sym]
            self.units[param_str] = param_default_unit.as_quantities_unit()

        self.NRNSUFFIX = self.buildparameters.suffix
Ejemplo n.º 6
0
    def __init__(self, simulation=None, name=None, does_require_simulation=True, **kwargs):

        if does_require_simulation:
            assert simulation is not None

        if simulation is not None and not simulation in NamedSimulationObject._obj_names:
            NamedSimulationObject._obj_names[simulation] = set()

        if not name:
            name = ObjectLabeller.get_next_unamed_object_name(
                    obj_type=NamedSimulationObject,
                    prefix='AnonObj')

        if does_require_simulation:
            assert not name in NamedSimulationObject._obj_names[simulation], 'Duplicate name:%s' % name
            NamedSimulationObject._obj_names[simulation].add(name)

        self._name = name
        self._simulation = simulation

        super(NamedSimulationObject, self).__init__(**kwargs)
Ejemplo n.º 7
0
    def __init__(self, **kwargs):
        super(NEURONPostSynapticTemplate_NeuroUnitEquationSetPostSynaptic, self).__init__( **kwargs)


        self.is_mod_built = False

        self.nmodl_txt, self.buildparameters = WriteToNMODL(self.eqnset, neuron_suffix="NRNEQNSETSYN"+ObjectLabeller.get_next_unamed_object_name(type(self), prefix=""))

        assert self.buildparameters.mechanismtype == MechanismType.Point
        self.units = {}
        for (param_str, value) in self._default_parameters.iteritems():
            sym = self.eqnset.get_terminal_obj(param_str)
            param_default_unit = self.buildparameters.symbol_units[sym]
            self.units[param_str] = param_default_unit.as_quantities_unit()

        self.NRNSUFFIX = self.buildparameters.suffix
Ejemplo n.º 8
0
    def __init__(self, **kwargs):
        super(Neuron_NeuroUnitEqnsetMechanism, self).__init__(**kwargs)

        self.nmodl_txt, self.buildparameters = WriteToNMODL(self.eqnset, neuron_suffix="NRNEQNSET"+ObjectLabeller.get_next_unamed_object_name(Neuron_NeuroUnitEqnsetMechanism, prefix=""))




        assert self.buildparameters.mechanismtype == MechanismType.Distributed
        self.units = {}
        for (param_str, value) in self._parameters.iteritems():
            sym = self.eqnset.get_terminal_obj(param_str)
            param_default_unit = self.buildparameters.symbol_units[sym]
            self.units[param_str] = param_default_unit.as_quantities_unit()

        self.NRNSUFFIX = self.buildparameters.suffix
Ejemplo n.º 9
0
 def __init__(self, **kwargs):
     super(NEURONChl_Base, self).__init__(**kwargs)
     self.mm_neuronNumber = ObjectLabeller.get_next_count_for_type( NEURONChl_Base)
     self.cachedNeuronSuffix = None