From 3558498fcf3779eac77b0851599a9e510fbbdad4 Mon Sep 17 00:00:00 2001 From: Christian Henkel Date: Sun, 17 Nov 2024 08:30:47 +0100 Subject: [PATCH] refactoring Signed-off-by: Christian Henkel --- planner/tcbs/plan.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/planner/tcbs/plan.py b/planner/tcbs/plan.py index fab541a0..28b696db 100644 --- a/planner/tcbs/plan.py +++ b/planner/tcbs/plan.py @@ -253,13 +253,13 @@ def assign_idle_goals( ): children = [] agent_idle = list(agent_idle) - for i_la in range(len(left_agent_pos)): + for pos in left_agent_pos: # which agent is it actually? - i_a = agent_pos.index(left_agent_pos[i_la]) - if not len(agent_idle[i_a]): # no idle goal yet - for i_ig in range(len(left_idle_goals)): + i_a = agent_pos.index(pos) + if len(agent_idle[i_a]) == 0: # no idle goal yet + for ig in left_idle_goals: agent_idle_new = agent_idle.copy() - agent_idle_new[i_a] = (idle_goals.index(left_idle_goals[i_ig]),) + agent_idle_new[i_a] = (idle_goals.index(ig),) children.append( comp2state(tuple(agent_job), tuple(agent_idle_new), blocked) )