Changeset 1045

Show
Ignore:
Timestamp:
12/22/11 14:54:26 (5 months ago)
Author:
pierre
Message:

Add the FastSmallWorldConnector? for Brian, and update NEST docstring to reflect the fact that FastConnectors? are using afferent instead of efferent for n_connections

Location:
trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/brian/connectors.py

    r1019 r1045  
    144144        else: 
    145145            raise errors.InvalidDimensionsError("OneToOneConnector does not support presynaptic and postsynaptic Populations of different sizes.") 
     146 
     147 
     148class FastSmallWorldConnector(SmallWorldConnector): 
     149     
     150    __doc__ = SmallWorldConnector.__doc__ 
     151     
     152    def connect(self, projection): 
     153        """Connect-up a Projection.""" 
     154        connector       = FastProbabilisticConnector(projection, self.weights, self.delays, self.allow_self_connections, self.space, safe=self.safe) 
     155        proba_generator = ProbaGenerator(self.d_expression, connector.local) 
     156        self.progressbar(len(projection.pre.local_cells)) 
     157        for count, tgt in enumerate(projection.pre.local_cells): 
     158            connector.distance_matrix.set_source(tgt.position) 
     159            proba  = proba_generator.get(connector.N, connector.distance_matrix) 
     160            connector._probabilistic_connect(tgt, proba, self.n_connections, self.rewiring) 
     161            self.progression(count, projection._simulator.state.mpi_rank) 
  • trunk/src/nest/connectors.py

    r1015 r1045  
    130130class FastDistanceDependentProbabilityConnector(DistanceDependentProbabilityConnector): 
    131131     
    132     __doc__ = DistanceDependentProbabilityConnector.__doc__ 
     132    """ 
     133        Create a new connector. 
     134         
     135        `d_expression` -- the right-hand side of a valid python expression for 
     136            probability, involving 'd', e.g. "exp(-abs(d))", or "d<3" 
     137        `n_connections`  -- The number of afferent synaptic connections per neuron.                  
     138        `space` -- a Space object. 
     139        `weights` -- may either be a float, a RandomDistribution object, a list/ 
     140                     1D array with at least as many items as connections to be 
     141                     created, or a distance expression as for `d_expression`. Units nA. 
     142        `delays`  -- as `weights`. If `None`, all synaptic delays will be set 
     143                     to the global minimum delay. 
     144        """ 
    133145     
    134146    def connect(self, projection): 
     
    201213class FastSmallWorldConnector(SmallWorldConnector): 
    202214     
    203     __doc__ = SmallWorldConnector.__doc__ 
     215    """ 
     216        Create a new connector. 
     217         
     218        `degree` -- the region lenght where nodes will be connected locally 
     219        `rewiring` -- the probability of rewiring each eadges  
     220        `space` -- a Space object. 
     221        `allow_self_connections` -- if the connector is used to connect a 
     222            Population to itself, this flag determines whether a neuron is 
     223            allowed to connect to itself, or only to other neurons in the 
     224            Population.         
     225        `n_connections`  -- The number of afferent synaptic connections per neuron.  
     226        `weights` -- may either be a float, a RandomDistribution object, a list/ 
     227                     1D array with at least as many items as connections to be 
     228                     created, or a DistanceDependence object. Units nA. 
     229        `delays`  -- as `weights`. If `None`, all synaptic delays will be set 
     230                     to the global minimum delay. 
     231        """ 
    204232     
    205233    def connect(self, projection):