def testFixedNumberPost(self): c1 = neuron.FixedNumberPostConnector(10) c2 = neuron.FixedNumberPostConnector(3) c3 = neuron.FixedNumberPostConnector(random.RandomDistribution('poisson',[5])) for srcP in [self.source5, self.source22]: for tgtP in [self.target6, self.target33]: for c in c1, c2: prj1 = neuron.Projection(srcP, tgtP, c) self.assertEqual(len(prj1.connections), c.n*len(srcP)) prj2 = neuron.Projection(srcP, tgtP, c3) # just a test that no Exceptions are raised self.assertRaises(Exception, neuron.FixedNumberPostConnector, None)
def setUp(self): sim.setup() self.p1 = sim.Population(7, sim.IF_cond_exp()) self.p2 = sim.Population(4, sim.IF_cond_exp()) self.p3 = sim.Population(5, sim.IF_curr_alpha()) self.syn1 = sim.StaticSynapse(weight=0.123, delay=0.5) self.syn2 = sim.StaticSynapse(weight=0.456, delay=0.4) self.random_connect = sim.FixedNumberPostConnector(n=2) self.all2all = sim.AllToAllConnector()