Skip to content

Commit 0c9732b

Browse files
committed
fix variable used before instantiation
1 parent 51a06a5 commit 0c9732b

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

jupyddl/data_analyst.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def __gather_data_astar(
5757
self, domain_path="", problem_path="", heuristic_key="goal_count"
5858
):
5959
has_multiple_files_tested = True
60-
if not domain_path and not problem_path:
60+
if not domain_path or not problem_path::
6161
has_multiple_files_tested = False
6262
metrics = dict()
6363
for problem, domain in self.__get_all_pddl_from_data():
@@ -92,7 +92,7 @@ def __gather_data_astar(
9292
"Heuristic is not implemented! (Key not found in registered heuristics dict)"
9393
)
9494
return [0], [0], has_multiple_files_tested
95-
return [total_time], [total_nodes], has_multiple_files_tested
95+
return [total_time], [opened_nodes], has_multiple_files_tested
9696

9797
def plot_astar_data(self, heuristic_key="goal_count", domain="", problem=""):
9898
if bool(not problem) != bool(not domain):
@@ -111,7 +111,7 @@ def plot_astar_data(self, heuristic_key="goal_count", domain="", problem=""):
111111

112112
def __gather_data_bfs(self, domain_path="", problem_path=""):
113113
has_multiple_files_tested = True
114-
if not domain_path and not problem_path:
114+
if not domain_path or not problem_path:
115115
has_multiple_files_tested = False
116116
metrics = dict()
117117
for problem, domain in self.__get_all_pddl_from_data():
@@ -130,7 +130,7 @@ def __gather_data_bfs(self, domain_path="", problem_path=""):
130130
logging.debug("Problem: " + problem_path)
131131
apla = AutomatedPlanner(domain_path, problem_path)
132132
_, total_time, opened_nodes = apla.breadth_first_search()
133-
return [total_time], [total_nodes], has_multiple_files_tested
133+
return [total_time], [opened_nodes], has_multiple_files_tested
134134

135135
def plot_bfs(self, domain="", problem=""):
136136
title = "BFS Statistics"
@@ -149,7 +149,7 @@ def plot_bfs(self, domain="", problem=""):
149149

150150
def __gather_data_dfs(self, domain_path="", problem_path=""):
151151
has_multiple_files_tested = True
152-
if not domain_path and not problem_path:
152+
if not domain_path or not problem_path::
153153
has_multiple_files_tested = False
154154
metrics = dict()
155155
for problem, domain in self.__get_all_pddl_from_data():
@@ -168,7 +168,7 @@ def __gather_data_dfs(self, domain_path="", problem_path=""):
168168
logging.debug("Problem: " + problem_path)
169169
apla = AutomatedPlanner(domain_path, problem_path)
170170
_, total_time, opened_nodes = apla.depth_first_search()
171-
return [total_time], [total_nodes], has_multiple_files_tested
171+
return [total_time], [opened_nodes], has_multiple_files_tested
172172

173173
def plot_dfs(self, problem="", domain=""):
174174
title = "DFS Statistics"
@@ -187,7 +187,7 @@ def plot_dfs(self, problem="", domain=""):
187187

188188
def __gather_data_dijkstra(self, domain_path="", problem_path=""):
189189
has_multiple_files_tested = True
190-
if not domain_path and not problem_path:
190+
if not domain_path or not problem_path::
191191
has_multiple_files_tested = False
192192
metrics = dict()
193193
for problem, domain in self.__get_all_pddl_from_data():
@@ -206,7 +206,7 @@ def __gather_data_dijkstra(self, domain_path="", problem_path=""):
206206
logging.debug("Problem: " + problem_path)
207207
apla = AutomatedPlanner(domain_path, problem_path)
208208
_, total_time, opened_nodes = apla.dijktra_best_first_search()
209-
return [total_time], [total_nodes], has_multiple_files_tested
209+
return [total_time], [opened_nodes], has_multiple_files_tested
210210

211211
def plot_dijkstra(self, problem="", domain=""):
212212
title = "Dijkstra Statistics"

0 commit comments

Comments
 (0)