@@ -30,25 +30,29 @@ def __init__(self, domain_path, problem_path):
3030 """
3131 Transition from one state to the next using an action
3232 """
33+
3334 def transition (self , state , action ):
3435 return self .pddl .transition (self .domain , state , action , check = False )
3536
3637 """
3738 Returns all available actions from the given state
3839 """
40+
3941 def available_actions (self , state ):
4042 return self .pddl .available (state , self .domain )
4143
4244 """
4345 Check if a vector of terms is satisfied by the given state
4446 """
47+
4548 def satisfies (self , asserted_state , state ):
4649 return self .pddl .satisfy (asserted_state , state , self .domain )[0 ]
4750
4851 """
4952 Check if the term is satisfied by the state
5053 To do: compare if it's faster to compute the check on a vector of terms in julia or python
5154 """
55+
5256 def state_has_term (self , state , term ):
5357 if self .pddl .has_term_in_state (self .domain , state , term ):
5458 return True
@@ -59,12 +63,14 @@ def state_has_term(self, state, term):
5963 Flatten the goal to a vector of terms
6064 To do: check if we can iterate over the jl vector
6165 """
66+
6267 def __flatten_goal (self ):
6368 return self .pddl .flatten_goal (self .problem )
6469
6570 """
6671 Retrieves the linked list path
6772 """
73+
6874 def __retrace_path (self , node ):
6975 if not node :
7076 return []
@@ -78,6 +84,7 @@ def __retrace_path(self, node):
7884 """
7985 Returns all the actions operated to reach the goal
8086 """
87+
8188 def get_actions_from_path (self , path ):
8289 if not path :
8390 logging .warning ("Path is empty, can't operate..." )
@@ -95,6 +102,7 @@ def get_actions_from_path(self, path):
95102 """
96103 Returns all the states that should be opened from start to goal
97104 """
105+
98106 def get_state_def_from_path (self , path ):
99107 if not path :
100108 logging .warning ("Path is empty, can't operate..." )
@@ -107,6 +115,7 @@ def get_state_def_from_path(self, path):
107115 """
108116 Runs the BFS algorithm on the loaded domain/problem
109117 """
118+
110119 def breadth_first_search (self , time_it = False ):
111120 if time_it :
112121 start_time = now ()
@@ -123,6 +132,7 @@ def breadth_first_search(self, time_it=False):
123132 """
124133 Runs the DFS algorithm on the domain/problem
125134 """
135+
126136 def depth_first_search (self , time_it = False ):
127137 if time_it :
128138 start_time = now ()
@@ -139,6 +149,7 @@ def depth_first_search(self, time_it=False):
139149 """
140150 Runs the Dijkstra algorithm on the domain/problem
141151 """
152+
142153 def dijktra_best_first_search (self , time_it = False ):
143154 if time_it :
144155 start_time = now ()
0 commit comments