Inside the following function (and in any other place in the algorithm), there is no checking for collisions between agents, that were already preassigned to specific locations by the LowLevelNode's constraints.
def configuration_generaotr(
self, N: HighLevelNode, C: LowLevelNode
) -> Config | None:
# setup next configuration
Q_to = Config([self.pibt.NIL_COORD for _ in range(self.num_agents)])
for k in range(C.depth):
Q_to[C.who[k]] = C.where[k]
# apply PIBT
success = self.pibt.step(N.Q, Q_to, N.order)
return Q_to if success else None
Something like the following code may assist to check the constraints:
# prep conf check
for agent1, agent2 in combinations(N.order, 2):
node_from_1 = config_from[agent1.name]
node_from_2 = config_from[agent2.name]
if node_from_1 == node_from_2:
return None
if agent1.name in config_to and agent2.name in config_to:
node_to_1 = config_to[agent1.name]
node_to_2 = config_to[agent2.name]
if node_to_1 == node_to_2:
return None
edge1 = (node_from_1.x, node_from_1.y, node_to_1.x, node_to_1.y)
edge2 = (node_to_2.x, node_to_2.y, node_from_2.x, node_from_2.y)
if edge1 == edge2:
return None
Inside the following function (and in any other place in the algorithm), there is no checking for collisions between agents, that were already preassigned to specific locations by the
LowLevelNode
's constraints.Something like the following code may assist to check the constraints:
Am I missing something?..
Thank you in advance