Skip to content

Commit

Permalink
Apply formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
guilyx authored and actions-user committed Feb 17, 2021
1 parent cc06581 commit a88d394
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
3 changes: 2 additions & 1 deletion pymapf/centralized/animator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
11 changes: 9 additions & 2 deletions pymapf/centralized/cooperative_astar/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import logging


class Agent:
def __init__(
self, ident, init_pos, goal_pos, allow_diagonals=False, nodes_dict=None
Expand All @@ -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)))
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pymapf/centralized/cooperative_astar/astar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pymapf/centralized/cooperative_astar/cooperative_astar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion pymapf/decentralized/nmpc/nmpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

# import threading
import logging
logging.getLogger('matplotlib').setLevel(logging.WARNING)

logging.getLogger("matplotlib").setLevel(logging.WARNING)


class MultiAgentNMPC:
Expand Down
3 changes: 2 additions & 1 deletion pymapf/decentralized/velocity_obstacle/velocity_obstacle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a88d394

Please sign in to comment.