55from datetime import datetime as timestamp
66from time import time as now
77
8+
89class DijkstraBestFirstSearch :
910 def __init__ (self , automated_planner ):
1011 self .automated_planner = automated_planner
@@ -13,7 +14,7 @@ def __init__(self, automated_planner):
1314 automated_planner ,
1415 is_closed = False ,
1516 is_open = True ,
16- heuristic = zero_heuristic
17+ heuristic = zero_heuristic ,
1718 )
1819 self .open_nodes_n = 1
1920 self .nodes = dict ()
@@ -25,7 +26,9 @@ def __hash(self, node):
2526 return string .split (sep , 1 )[0 ] + ")"
2627
2728 def search (self ):
28- self .automated_planner .logger .debug ("Search started at: " + str (timestamp .now ()))
29+ self .automated_planner .logger .debug (
30+ "Search started at: " + str (timestamp .now ())
31+ )
2932 time_start = now ()
3033 while self .open_nodes_n > 0 :
3134 current_key = min (
@@ -38,7 +41,9 @@ def search(self):
3841 self .automated_planner .problem .goal , current_node .state
3942 ):
4043 computation_time = now () - time_start
41- self .automated_planner .logger .debug ("Search finished at: " + str (timestamp .now ()))
44+ self .automated_planner .logger .debug (
45+ "Search finished at: " + str (timestamp .now ())
46+ )
4247 return current_node , computation_time
4348
4449 current_node .is_closed = True
0 commit comments