Ejemplo n.º 1
0
    def test_search_failure(self):
        ids = IterativeDeepeningSearch()
        # 5 - is a goal state but it's unreachable
        problem = Problem(1, TestActionsFunction(2), TestResultFunction(), TestGoalTest(5))

        result = ids.search(problem)
        self.assertTrue(ids.is_failure(result))
Ejemplo n.º 2
0
    def test_successful_search(self):
        ids = IterativeDeepeningSearch()
        problem = Problem(1, TestActionsFunction(), TestResultFunction(),
                          TestGoalTest(4))

        result = ids.search(problem)
        self.assertEquals(3, len(result))
Ejemplo n.º 3
0
    def test_search_failure(self):
        ids = IterativeDeepeningSearch()
        # 5 - is a goal state but it's unreachable
        problem = Problem(1, TestActionsFunction(2), TestResultFunction(),
                          TestGoalTest(5))

        result = ids.search(problem)
        self.assertTrue(ids.is_failure(result))
Ejemplo n.º 4
0
    def test_successful_search(self):
        ids = IterativeDeepeningSearch()
        problem = Problem(1, TestActionsFunction(), TestResultFunction(), TestGoalTest(4))

        result = ids.search(problem)
        self.assertEquals(3, len(result))