예제 #1
0
 def test_connect_with_default_args(self):
     C = connectors.DistanceDependentProbabilityConnector(
         d_expression="d<1.5", rng=MockRNG(delta=0.01))
     syn = sim.StaticSynapse()
     prj = sim.Projection(self.p1, self.p2, C, syn)
     # 20 possible connections. Only those with a sufficiently small distance
     # are created
     self.assertEqual(
         prj.get(["weight", "delay"], format='list', gather=False
                 ),  # use gather False because we are faking the MPI
         [(0, 1, 0.0, 0.123), (1, 1, 0.0, 0.123), (2, 1, 0.0, 0.123),
          (2, 3, 0.0, 0.123), (3, 3, 0.0, 0.123)])
예제 #2
0
 def test_connect_with_default_args(self):
     C = connectors.DistanceDependentProbabilityConnector(
         d_expression="d<62.5")
     C.progressbar = Mock()
     C.progression = Mock()
     C.connect(self.prj)
     # 20 possible connections. Only those with a sufficiently small distance
     # are created
     assert_equal(self.prj.connections, [(18, 80, 0.0, MIN_DELAY),
                                         (19, 80, 0.0, MIN_DELAY),
                                         (20, 80, 0.0, MIN_DELAY),
                                         (20, 82, 0.0, MIN_DELAY)])