Beispiel #1
0
 def testDFSErr1B(self):
     target = 10
     tree_space = TreeSpace(TreeState(self.root), target)
     solver = IterativeDeepening(tree_space)
     sol, err = solver.DFS(tree_space.start_point, 2)
     self.assertEqual(None, sol)
     self.assertEqual(1, err)
     self.assertEqual(6, solver.num_states_seen)
Beispiel #2
0
 def testDFSErr2(self):
     target = 10
     tree_space = TreeSpace(TreeState(self.root), target)
     solver = IterativeDeepening(tree_space, max_states_num=7)
     sol, err = solver.DFS(tree_space.start_point)
     self.assertEqual(None, sol)
     self.assertEqual(2, err)
     self.assertEqual(7, solver.num_states_seen)
Beispiel #3
0
 def testDFSErr0B(self):
     target = 10
     tree_space = TreeSpace(TreeState(self.root), target)
     solver = IterativeDeepening(tree_space)
     sol, err = solver.DFS(tree_space.start_point, 3)
     self.assertEqual(target, sol.state.val)
     self.assertEqual(0, err)
     self.assertEqual(8, solver.num_states_seen)