コード例 #1
0
ファイル: test_online.py プロジェクト: mushketyk/aima-python
    def test_no_path(self):
        map = ExtendableMap()
        map.add_bidirectional_link('A', 'B', 1)
        me = MapEnvironment(map)
        agent = OnlineDFSAgent(OnlineSearchProblem(MapActionFunction(map), MapGoalTestFunction("G"), MapStepCostFunction(map)),
                               MapPerceptToStateFunction())

        me.add_new_agent(agent, "A")
        locations = ['B', 'A', 'B', 'A']
        expected_actions = get_move_to_actions_array(locations)
        me.add_environment_view(EnvironmentViewMock(expected_actions))

        me.step_until_done()
コード例 #2
0
 def setUp(self):
     map = ExtendableMap()
     map.add_bidirectional_link("A", "B", 4)
     map.add_bidirectional_link("B", "C", 4)
     map.add_bidirectional_link("C", "D", 4)
     map.add_bidirectional_link("D", "E", 4)
     map.add_bidirectional_link("E", "F", 4)
     self.map = map
コード例 #3
0
    def test_no_path(self):
        map = ExtendableMap()
        map.add_bidirectional_link('A', 'B', 1)
        me = MapEnvironment(map)
        agent = OnlineDFSAgent(
            OnlineSearchProblem(MapActionFunction(map),
                                MapGoalTestFunction("G"),
                                MapStepCostFunction(map)),
            MapPerceptToStateFunction())

        me.add_new_agent(agent, "A")
        locations = ['B', 'A', 'B', 'A']
        expected_actions = get_move_to_actions_array(locations)
        me.add_environment_view(EnvironmentViewMock(expected_actions))

        me.step_until_done()
コード例 #4
0
ファイル: test_online.py プロジェクト: mushketyk/aima-python
 def setUp(self):
     map = ExtendableMap()
     map.add_bidirectional_link("A", "B", 4)
     map.add_bidirectional_link("B", "C", 4)
     map.add_bidirectional_link("C", "D", 4)
     map.add_bidirectional_link("D", "E", 4)
     map.add_bidirectional_link("E", "F", 4)
     self.map = map