-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
87 lines (79 loc) · 1.67 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import planner
def main():
## Test 0
plan = planner.find_plan("student_domain.pddl", "task00.pddl")
print "Test 0"
if plan.ok:
print '\n'.join(a for a in plan.plan)
if len(plan.plan) > 1 and len(plan.plan) < 4:
print "Pass Test 0"
else:
print "Fail Test 0"
exit(1)
else:
print "ERROR"
print plan.error
print "Fail Test 0"
exit(1)
## Test 1
plan = planner.find_plan("student_domain.pddl", "task01.pddl")
print "Test 1"
if plan.ok:
print '\n'.join(a for a in plan.plan)
if len(plan.plan) > 2:
print "Pass Test 1"
else:
print "Fail Test 1"
exit(1)
else:
print "ERROR"
print plan.error
print "Fail Test 1"
exit(1)
## Test 2
plan = planner.find_plan("student_domain.pddl", "task02.pddl")
print "Test 2"
if plan.ok:
print '\n'.join(a for a in plan.plan)
if len(plan.plan) > 2 and len(plan.plan) < 10:
print "Pass Test 2"
else:
print "Fail Test 2"
exit(1)
else:
print "ERROR"
print plan.error
print "Fail Test 2"
exit(1)
## Test 3
plan = planner.find_plan("student_domain.pddl", "task03.pddl")
print "Test 3"
if plan.ok:
print '\n'.join(a for a in plan.plan)
if len(plan.plan) > 4 and len(plan.plan) < 18:
print "Pass Test 3"
else:
print "Fail Test 3"
exit(1)
else:
print "ERROR"
print plan.error
print "Fail Test 3"
exit(1)
## Test 4
plan = planner.find_plan("student_domain.pddl", "task04.pddl")
print "Test 4"
if plan.ok:
print '\n'.join(a for a in plan.plan)
if len(plan.plan) > 1 and len(plan.plan) < 4:
print "Pass Test 4"
else:
print "Fail Test 4"
exit(1)
else:
print "ERROR"
print plan.error
print "Fail Test 4"
exit(1)
if __name__ == '__main__':
main()