jakobaxelsson / sossim

A system-of-systems (SoS) simulator
MIT License
0 stars 0 forks source link

Collisions when entering destination which has vehicle #20

Closed jakobaxelsson closed 11 months ago

jakobaxelsson commented 11 months ago

In the relatively rare case where an agent wishes to enter a destination where another agent is already present, a collision can occur, which then raises an exception. This indicates two kinds of problems:

  1. The vehicle planning function should detect this situation for the agent outside the destination. It should generate a plan to drive on, in order to avoid the deadlock.
  2. Even if a plan occurs where the deadlock is present, the precondition to Move/FollowRoute should detect this and prevent the vehicle from moving.
jakobaxelsson commented 11 months ago

This is possibly related to the world model of the agent. It is the world model that is used for calculating the precondition, and in the case where the two vehicles are trying to move into a node from opposite directions, they will be two steps away. Hence, they are not within visible range. and the preconditions will be true. (If, on the other hand, they come from orthogonal directions, they are within visible range, and will detect each other.)

Two possible alternatives exist to solve this:

  1. Change back the space used in preconditions to that of the model, instead of that of the world model. This is reasonable if we interpret the preconditions to mean whether it is physically possible.
  2. Extend the range of the world model. This is reasonable if we interpret the preconditions to mean that the driver will not perform this action.

The second option is really just about setting the value of the parameter perception_range to 2 instead of 1, so it is simpler. It also makes more sense logically, since it does actually not physically prevent accidents from happening.