-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcreate_temporal_problem.py
37 lines (27 loc) · 1.06 KB
/
create_temporal_problem.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
from numpy import negative
from examples.create_temporal_domain import create_temporal_domain
from pddl.problem import Problem
def create_temporal_problem() -> Problem:
domain = create_temporal_domain()
problem = Problem("match_problem", domain)
# objects
problem.add_object("match1", "match")
problem.add_object("match2", "match")
problem.add_object("fuse1", "fuse")
problem.add_object("fuse2", "fuse")
# initial state
problem.add_proposition_from_str("unused", ["match1"])
problem.add_proposition_from_str("unused", ["match2"])
problem.add_proposition_from_str("unused", ["match2"])
# ...function assignments
problem.add_assignment_from_str(0.0, "fuses_mended")
# ...TILs
problem.add_til_from_str(10.0, "handempty")
problem.add_til_from_str(20.0, "handempty", negative=True)
# goal
problem.add_simple_goal_from_str("mended", ["fuse1"])
problem.add_simple_goal_from_str("mended", ["fuse2"])
return problem
if __name__ == "__main__":
problem = create_temporal_problem()
print(problem)