Esempio n. 1
0
 def test_outdegree4(self):
     numStates = 50
     numActions = 1000
     G = gen.rgud(numStates, numActions)
     for node in G:
         succ = [y for (x,y) in G.edges() if x==node]
         self.assertEqual(len(succ), numActions)
Esempio n. 2
0
 def test_outdegree4(self):
     numStates = 50
     numActions = 1000
     G = gen.rgud(numStates, numActions)
     for node in G:
         succ = [y for (x, y) in G.edges() if x == node]
         self.assertEqual(len(succ), numActions)
Esempio n. 3
0
 def test_connectedness(self):
     ntests = 50
     nsuccess = 0
     for test in range(ntests):
         numStates = npr.randint(100, 5000)
         numActions = npr.randint(2, 20)
         G = gen.make_strongly_connected(gen.rgud(numStates, numActions))
         if nx.number_strongly_connected_components(G) == 1:
             nsuccess += 1
     self.assertEqual(nsuccess, ntests)
Esempio n. 4
0
 def test_connectedness(self):
     ntests = 50
     nsuccess = 0
     for test in range(ntests):
         numStates = npr.randint(100, 5000)
         numActions = npr.randint(2, 20)
         G = gen.make_strongly_connected(gen.rgud(numStates, numActions))
         if nx.number_strongly_connected_components(G) == 1:
             nsuccess += 1
     self.assertEqual(nsuccess, ntests)