diff --git a/pymapf/centralized/animator.py b/pymapf/centralized/animator.py index 1552c1f..8846239 100644 --- a/pymapf/centralized/animator.py +++ b/pymapf/centralized/animator.py @@ -14,7 +14,8 @@ from matplotlib import animation import math import logging -logging.getLogger('matplotlib').setLevel(logging.WARNING) + +logging.getLogger("matplotlib").setLevel(logging.WARNING) Colors = ["skyblue", "blue", "orange"] diff --git a/pymapf/centralized/cooperative_astar/agent.py b/pymapf/centralized/cooperative_astar/agent.py index a4eb42a..118ef06 100644 --- a/pymapf/centralized/cooperative_astar/agent.py +++ b/pymapf/centralized/cooperative_astar/agent.py @@ -5,6 +5,7 @@ import logging + class Agent: def __init__( self, ident, init_pos, goal_pos, allow_diagonals=False, nodes_dict=None @@ -25,7 +26,10 @@ def in_conflict(self, current_state, future_state, other_agents_paths): try: if future_state.x == val[-1].x and future_state.y == val[-1].y: - logging.debug("Found conflict between agent %s and agent %s" % (self.ident, key)) + logging.debug( + "Found conflict between agent %s and agent %s" + % (self.ident, key) + ) return True except BaseException as e: logging.debug("Agent %s path is empty: %s" % (key, str(e))) @@ -43,7 +47,10 @@ def in_conflict(self, current_state, future_state, other_agents_paths): for c in conflicts: if c in val: - logging.warning("Found conflict between agent %s and agent %s" % (self.ident, key)) + logging.warning( + "Found conflict between agent %s and agent %s" + % (self.ident, key) + ) self.conflicts_found += 1 return True return False diff --git a/pymapf/centralized/cooperative_astar/astar.py b/pymapf/centralized/cooperative_astar/astar.py index 9a94010..3fcda0f 100644 --- a/pymapf/centralized/cooperative_astar/astar.py +++ b/pymapf/centralized/cooperative_astar/astar.py @@ -117,8 +117,8 @@ def get_successors(self, parent: Node) -> List[Node]: if self.agent.in_conflict( State(parent.pos_x, parent.pos_y, parent.t), - State(pos_x, pos_y, parent.t+1), - self.global_paths + State(pos_x, pos_y, parent.t + 1), + self.global_paths, ): continue diff --git a/pymapf/centralized/cooperative_astar/cooperative_astar.py b/pymapf/centralized/cooperative_astar/cooperative_astar.py index 82d401c..ac998a5 100644 --- a/pymapf/centralized/cooperative_astar/cooperative_astar.py +++ b/pymapf/centralized/cooperative_astar/cooperative_astar.py @@ -40,7 +40,7 @@ def run_simulation(self): self.searches_sim_times.append(self.paths[agent.ident][-1].t) except BaseException as e: logging.debug(e) - + self.simulation_complete = True def visualize(self, save_file): diff --git a/pymapf/decentralized/nmpc/nmpc.py b/pymapf/decentralized/nmpc/nmpc.py index 7a8bad7..a6f8942 100644 --- a/pymapf/decentralized/nmpc/nmpc.py +++ b/pymapf/decentralized/nmpc/nmpc.py @@ -21,7 +21,8 @@ # import threading import logging -logging.getLogger('matplotlib').setLevel(logging.WARNING) + +logging.getLogger("matplotlib").setLevel(logging.WARNING) class MultiAgentNMPC: diff --git a/pymapf/decentralized/velocity_obstacle/velocity_obstacle.py b/pymapf/decentralized/velocity_obstacle/velocity_obstacle.py index e4f4c93..7abc721 100644 --- a/pymapf/decentralized/velocity_obstacle/velocity_obstacle.py +++ b/pymapf/decentralized/velocity_obstacle/velocity_obstacle.py @@ -21,7 +21,8 @@ from matplotlib.patches import Circle import coloredlogs import logging -logging.getLogger('matplotlib').setLevel(logging.WARNING) + +logging.getLogger("matplotlib").setLevel(logging.WARNING) class MultiAgentVelocityObstacle: