Example #1
0
 def to_nineml(self, label):
     connector_parameters = {}
     for name in self.__class__.parameter_names:
         connector_parameters[name] = getattr(self, name)
     connection_rule = nineml.ConnectionRule(
                                 name="connection rule for projection %s" % label,
                                 definition=nineml.Definition(self.definition_url),
                                 parameters=build_parameter_set(connector_parameters))
     return connection_rule
Example #2
0
 def to_nineml(self):
     if self.structure:
         structure = nineml.Structure(
                                 name="structure for %s" % self.label,
                                 definition=nineml.Definition("%s/networkstructures/%s.xml" % (catalog_url, self.structure.__class__.__name__)),
                                 parameters=build_parameter_set(self.structure.get_parameters())
                                 )
     else:
         structure = None
     population = nineml.Population(
                             name=self.label,
                             number=len(self),
                             prototype=self.celltype.to_nineml(self.label)[0],
                             positions=nineml.PositionList(structure=structure))
     return population
Example #3
0
 def to_nineml(self):
     if self.structure:
         structure = nineml.Structure(
                                 name="structure for %s" % self.label,
                                 definition=nineml.Definition("%s/networkstructures/%s.xml" % (catalog_url, self.structure.__class__.__name__)),
                                 parameters=build_parameter_set(self.structure.get_parameters())
                                 )
     else:
         structure = None
     population = nineml.Population(
                             name=self.label,
                             number=len(self),
                             prototype=self.celltype.to_nineml(self.label)[0],
                             positions=nineml.PositionList(structure=structure))
     return population
Example #4
0
 def to_nineml(self):
     connection_rule = self._method.to_nineml(self.label)
     connection_type = nineml.ConnectionType(
                                 name="connection type for projection %s" % self.label,
                                 definition=nineml.Definition("%s/connectiontypes/static_synapse.xml" % catalog_url),
                                 parameters=build_parameter_set(
                                              {"weight": self._method.weights,
                                               "delay": self._method.delays}))
     synaptic_responses = self.post.get_synaptic_response_components(self.target)
     synaptic_response, = synaptic_responses
     projection = nineml.Projection(
                             name=self.label,
                             source=self.pre.to_nineml(), # or just pass ref, and then resolve later?
                             target=self.post.to_nineml(),
                             rule=connection_rule,
                             synaptic_response=synaptic_response,
                             connection_type=connection_type)
     return projection
Example #5
0
 def to_nineml(self):
     connection_rule = self._method.to_nineml(self.label)
     connection_type = nineml.ConnectionType(
                                 name="connection type for projection %s" % self.label,
                                 definition=nineml.Definition("%s/connectiontypes/static_synapse.xml" % catalog_url),
                                 parameters=build_parameter_set(
                                              {"weight": self._method.weights,
                                               "delay": self._method.delays}))
     synaptic_responses = self.post.get_synaptic_response_components(self.target)
     synaptic_response, = synaptic_responses
     projection = nineml.Projection(
                             name=self.label,
                             source=self.pre.to_nineml(), # or just pass ref, and then resolve later?
                             target=self.post.to_nineml(),
                             rule=connection_rule,
                             synaptic_response=synaptic_response,
                             connection_type=connection_type)
     return projection
Example #6
0
 def to_nineml(self):
     return nineml.CurrentSourceType(
                         name="current source %d" % self.__class__.counter,
                         definition=nineml.Definition("%s/currentsources/%s" % (catalog_url, self.definition_file)),
                         parameters=build_parameter_set(self.parameters))
Example #7
0
 def to_nineml(self):
     return nineml.CurrentSourceType(
         name="current source %d" % self.__class__.counter,
         definition=nineml.Definition("%s/currentsources/%s" %
                                      (catalog_url, self.definition_file)),
         parameters=build_parameter_set(self.parameters))