-
Notifications
You must be signed in to change notification settings - Fork 0
/
modeling_line
39 lines (25 loc) · 1.06 KB
/
modeling_line
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
using PDDL, PlanningDomains
using SymbolicPlanners
import SymbolicPlanners: precompute!, is_precomputed, compute
# Load domain and problem
path = "/Users/joekwon/Desktop/line_modeling"
multi_agent_lines = load_domain(joinpath(path, "domain.pddl"))
mal_problem = load_problem(joinpath(path, "no_line_3.pddl"))
# Register array theory for gridworld domains
PDDL.Arrays.@register()
#multi_agent_lines = load_domain(:multi_agent_lines)
#mal_problem = load_problem(:doors_keys_gems, "yes_line_7")
mal_state = initstate(multi_agent_lines, mal_problem)
mal_spec = Specification(mal_problem)
domain = multi_agent_lines
state = mal_state
actions = available(domain, state)
#state = execute(domain, state, pddl"(up(agent1))")
#c_domain, c_state = compiled(domain, state)
planner = AStarPlanner(WellTankHeuristic())
heuristic = WellTankHeuristic()
planner = MultiAgentRTDP(heuristic=heuristic, rollout_noise=2.0, n_rollouts=50)
sol = planner(domain, state, mal_spec)
print(sol.plan)
simulator = StateActionRecorder(100)
actions, trajectory = simulator(sol, domain, state, mal_spec)