Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 80dbdf8

Browse files
sofmonknorvig
authored andcommitted
added another test for air_cargo_problem (aimacode#465)
1 parent 4d9bea0 commit 80dbdf8

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

tests/test_planning.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,33 @@ def test_action():
1818
assert not a.check_precond(test_kb, args)
1919

2020

21-
def test_air_cargo():
21+
def test_air_cargo_1():
2222
p = air_cargo()
2323
assert p.goal_test() is False
24-
solution = [expr("Load(C1 , P1, SFO)"),
24+
solution_1 = [expr("Load(C1 , P1, SFO)"),
2525
expr("Fly(P1, SFO, JFK)"),
2626
expr("Unload(C1, P1, JFK)"),
2727
expr("Load(C2, P2, JFK)"),
2828
expr("Fly(P2, JFK, SFO)"),
29-
expr("Unload (C2, P2, SFO)")]
29+
expr("Unload (C2, P2, SFO)")]
3030

31-
for action in solution:
31+
for action in solution_1:
32+
p.act(action)
33+
34+
assert p.goal_test()
35+
36+
37+
def test_air_cargo_2():
38+
p = air_cargo()
39+
assert p.goal_test() is False
40+
solution_2 = [expr("Load(C2, P2, JFK)"),
41+
expr("Fly(P2, JFK, SFO)"),
42+
expr("Unload (C2, P2, SFO)"),
43+
expr("Load(C1 , P1, SFO)"),
44+
expr("Fly(P1, SFO, JFK)"),
45+
expr("Unload(C1, P1, JFK)")]
46+
47+
for action in solution_2:
3248
p.act(action)
3349

3450
assert p.goal_test()

0 commit comments

Comments
 (0)