-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
41 lines (35 loc) · 1.25 KB
/
__init__.py
File metadata and controls
41 lines (35 loc) · 1.25 KB
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
import sys
from pddlToGraphs import parseDomAndProb
from Planner import preprocessDomain
from Flaws import FlawLib
from Planner import obTypesDict
from Element import Argument
from Planner import PlanSpacePlanner
from Planner import topoSort
from PlanElementGraph import Action
if __name__ == '__main__':
num_args = len(sys.argv)
if num_args >1:
domain_file = sys.argv[1]
if num_args > 2:
problem_file = sys.argv[2]
else:
#domain_file = 'domains/mini-indy-domain.pddl'
#problem_file = 'domains/mini-indy-problem.pddl'
domain_file = 'domains/ark-domain.pddl'
problem_file = 'domains/ark-problem.pddl'
#f = open('workfile', 'w')
operators, objects, object_types, initAction, goalAction = parseDomAndProb(domain_file, problem_file)
#non_static_preds = preprocessDomain(operators)
FlawLib.non_static_preds = preprocessDomain(operators)
obtypes = obTypesDict(object_types)
Argument.object_types = obtypes
planner = PlanSpacePlanner(operators, objects, initAction, goalAction)
#planner.story_GL = GLib(operators, story_objs, obtypes, initAction, goalAction)
results = planner.POCL(1)
for result in results:
totOrdering = topoSort(result)
print('\n\n\n')
for step in topoSort(result):
print(Action.subgraph(result, step))
#print(result)