Ejemplo n.º 1
0
 def test_extended_barabasi_albert_topology_zero_seed(self):
     a = fnss.extended_barabasi_albert_topology(100,
                                                11,
                                                16,
                                                0.2,
                                                0.3,
                                                seed=0)
     b = fnss.extended_barabasi_albert_topology(100,
                                                11,
                                                16,
                                                0.2,
                                                0.3,
                                                seed=0)
     self.assertEqual(set(a.edges()), set(b.edges()))
Ejemplo n.º 2
0
 def test_extended_barabasi_albert_topology(self):
     self.assertRaises(ValueError, fnss.extended_barabasi_albert_topology, 0, 20, 30, 0.2, 0.3)
     self.assertRaises(ValueError, fnss.extended_barabasi_albert_topology, 60, 30, 20, 0.2, 0.3)
     self.assertRaises(ValueError, fnss.extended_barabasi_albert_topology, 60, 20, 30, 0.6, 0.7)
     self.assertRaises(ValueError, fnss.extended_barabasi_albert_topology, 20, 11, 16, 1.2, 0.3)
     self.assertRaises(ValueError, fnss.extended_barabasi_albert_topology, 20, 11, 16, 0.3, 1.2)
     self.assertRaises(ValueError, fnss.extended_barabasi_albert_topology, 20, 11, 16, -0.2, 0.3)
     self.assertRaises(ValueError, fnss.extended_barabasi_albert_topology, 20, 11, 16, 0.3, -0.2)
     self.assertRaises(ValueError, fnss.extended_barabasi_albert_topology, 16, 11, 20, 0.2, 0.3)
     topology = fnss.extended_barabasi_albert_topology(100, 11, 16, 0.2, 0.3)
     self.assertEqual(100, topology.number_of_nodes())
Ejemplo n.º 3
0
 def test_extended_barabasi_albert_topology_constant_seed(self):
     a = fnss.extended_barabasi_albert_topology(100,
                                                11,
                                                16,
                                                0.2,
                                                0.3,
                                                seed=1)
     b = fnss.extended_barabasi_albert_topology(100,
                                                11,
                                                16,
                                                0.2,
                                                0.3,
                                                seed=2)
     c = fnss.extended_barabasi_albert_topology(100,
                                                11,
                                                16,
                                                0.2,
                                                0.3,
                                                seed=1)
     self.assertEqual(set(a.edges()), set(c.edges()))
     self.assertNotEqual(set(a.edges()), set(b.edges()))
Ejemplo n.º 4
0
 def test_extended_barabasi_albert_topology_zero_seed(self):
     a = fnss.extended_barabasi_albert_topology(100, 11, 16, 0.2, 0.3, seed=0)
     b = fnss.extended_barabasi_albert_topology(100, 11, 16, 0.2, 0.3, seed=0)
     self.assertEqual(set(a.edges()), set(b.edges()))
Ejemplo n.º 5
0
 def test_extended_barabasi_albert_topology_constant_seed(self):
     a = fnss.extended_barabasi_albert_topology(100, 11, 16, 0.2, 0.3, seed=1)
     b = fnss.extended_barabasi_albert_topology(100, 11, 16, 0.2, 0.3, seed=2)
     c = fnss.extended_barabasi_albert_topology(100, 11, 16, 0.2, 0.3, seed=1)
     self.assertEqual(set(a.edges()), set(c.edges()))
     self.assertNotEqual(set(a.edges()), set(b.edges()))