diff --git a/src/overcooked_ai_py/agents/agent.py b/src/overcooked_ai_py/agents/agent.py index d9471f6b..4ffb0f40 100644 --- a/src/overcooked_ai_py/agents/agent.py +++ b/src/overcooked_ai_py/agents/agent.py @@ -445,7 +445,7 @@ def get_lowest_cost_action_and_goal(self, start_pos_and_or, motion_goals): Chooses motion goal that has the lowest cost action plan. Returns the motion goal itself and the first action on the plan. """ - min_cost = np.Inf + min_cost = np.inf best_action, best_goal = None, None for goal in motion_goals: action_plan, _, plan_cost = self.mlam.motion_planner.get_plan( diff --git a/src/overcooked_ai_py/mdp/overcooked_env.py b/src/overcooked_ai_py/mdp/overcooked_env.py index da856e8b..6d6478ab 100644 --- a/src/overcooked_ai_py/mdp/overcooked_env.py +++ b/src/overcooked_ai_py/mdp/overcooked_env.py @@ -424,7 +424,7 @@ def execute_plan(self, start_state, joint_action_plan, display=False): return successor_state, done def run_agents( - self, + self,np.inf agent_pair, include_final_state=False, display=False, @@ -485,7 +485,7 @@ def run_agents( def get_rollouts( self, - agent_pair, + agent_pair,np.inf num_games, display=False, dir=None, diff --git a/src/overcooked_ai_py/planning/planners.py b/src/overcooked_ai_py/planning/planners.py index 15d15b2d..0ba4d17b 100644 --- a/src/overcooked_ai_py/planning/planners.py +++ b/src/overcooked_ai_py/planning/planners.py @@ -165,7 +165,7 @@ def get_gridworld_pos_distance(self, pos1, pos2): to go from starting position to goal position (not including interaction action).""" # NOTE: currently unused, pretty bad code. If used in future, clean up - min_cost = np.Inf + min_cost = np.inf for d1, d2 in itertools.product(Direction.ALL_DIRECTIONS, repeat=2): start = (pos1, d1) end = (pos2, d2) @@ -364,8 +364,8 @@ def min_cost_between_features( Determines the minimum number of timesteps necessary for a player to go from any terrain feature in list1 to any feature in list2 and perform an interact action """ - min_dist = np.Inf - min_manhattan = np.Inf + min_dist = np.inf + min_manhattan = np.inf for pos1, pos2 in itertools.product(pos_list1, pos_list2): for mg1, mg2 in itertools.product( self.motion_goals_for_pos[pos1], @@ -383,7 +383,7 @@ def min_cost_between_features( min_dist = curr_dist # +1 to account for interaction action - if manhattan_if_fail and min_dist == np.Inf: + if manhattan_if_fail and min_dist == np.inf: min_dist = min_manhattan min_cost = min_dist + 1 return min_cost @@ -401,7 +401,7 @@ def min_cost_to_feature( """ start_pos = start_pos_and_or[0] assert self.mdp.get_terrain_type_at_pos(start_pos) != "X" - min_dist = np.Inf + min_dist = np.inf best_feature = None for feature_pos in feature_pos_list: for feature_goal in self.motion_goals_for_pos[feature_pos]: @@ -841,7 +841,7 @@ def _handle_conflict_with_same_goal_idx( if self._agents_are_in_same_position( (curr_pos_or0, curr_pos_or1) ): - return None, None, [np.Inf, np.Inf] + return None, None, [np.inf, np.inf] else: curr_pos_or0, curr_pos_or1 = next_pos_or0, next_pos_or1 @@ -860,7 +860,7 @@ def _handle_conflict_with_same_goal_idx( end_pos_and_or = (curr_pos_or0, curr_pos_or1) finishing_times = ( - (np.Inf, idx1) if wait_agent_idx == 0 else (idx0, np.Inf) + (np.inf, idx1) if wait_agent_idx == 0 else (idx0, np.inf) ) return joint_plan, end_pos_and_or, finishing_times