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)
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)
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)