We found the following behaviour when simulating multiple vehicles in rinsim: Vehicles can drive through each other without colliding just fine as we intend, but sometimes we get the exception below:
Taxi eda0940 is travelling on connection (30.0,22.0)-(30.0,26.0)
Taxi 3578436e is travelling in the opposite direction of that connection (30.0,26.0)-(30.0,22.0)
Both taxis seem to collide and get the exception that they can't jump or change directions. They were both travelling in the correct direction and the one they want to keep following. Can someone explain this behaviour?
If it really is a collision of two taxis we would expect a different exception. Also why would these collisions only happen in some of the cases.
taxi.Taxi@2eda0940: Current intended path: [(30.0,26.0), (30.0,30.0), (34.0,30.0), (38.0,30.0), (42.0,30.0), (46.0,30.0), (50.0,30.0), (54.0,30.0), (58.0,30.0)]
taxi.Taxi@2eda0940: Following path [(30.0,22.92888888888889), (30.0,26.0)]
taxi.Taxi@2eda0940: Current position (30.0,22.92888888888889)
taxi.Taxi@2eda0940: Current connection Optional.of(Connection{from=(30.0,22.0), to=(30.0,26.0), data=Optional.absent()})
java.lang.IllegalArgumentException: Illegal path for this object, from a position on a connection we can not jump to another connection or go back. From (30.0,22.92888888888889), to (30.0,26.0).
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:146)
at com.github.rinde.rinsim.core.model.road.GraphRoadModelImpl.checkMoveValidity(GraphRoadModelImpl.java:241)
at com.github.rinde.rinsim.core.model.road.GraphRoadModelImpl.doFollowPath(GraphRoadModelImpl.java:169)
at com.github.rinde.rinsim.core.model.road.AbstractRoadModel.followPath(AbstractRoadModel.java:94)
at taxi.Taxi.delegate_mas_impl(Taxi.java:262)
at taxi.Taxi.tickImpl(Taxi.java:366)
at com.github.rinde.rinsim.core.model.pdp.Vehicle.tick(Vehicle.java:55)
at com.github.rinde.rinsim.core.model.time.TimeModel.tickImpl(TimeModel.java:139)
at com.github.rinde.rinsim.core.model.time.SimulatedTimeModel.doStart(SimulatedTimeModel.java:32)
at com.github.rinde.rinsim.core.model.time.TimeModel.start(TimeModel.java:94)
at com.github.rinde.rinsim.ui.SimulationViewer$5.run(SimulationViewer.java:401)
taxi.Taxi@3578436e: Optional.of(Connection{from=(30.0,26.0), to=(30.0,22.0), data=Optional.absent()})
taxi.Taxi@3578436e: []
taxi.Taxi@3578436e: 1920000
taxi.Taxi@3578436e: Moving to (30.0,22.0)
taxi.Taxi@3578436e:
taxi.Taxi@3578436e: Current intended path: [(30.0,22.0), (30.0,18.0), (30.0,14.0), (16.0,16.0), (12.0,16.0), (8.0,16.0), (4.0,16.0), (0.0,16.0), (0.0,12.0), (0.0,8.0)]
taxi.Taxi@3578436e: Following path [(30.0,22.92888888888889), (30.0,22.0)]
java.lang.IllegalArgumentException: Illegal path for this object, from a position on a connection we can not jump to another connection or go back. From (30.0,22.92888888888889), to (30.0,22.0).
taxi.Taxi@3578436e: Current position (30.0,22.92888888888889)
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:146)
taxi.Taxi@3578436e: Current connection Optional.of(Connection{from=(30.0,26.0), to=(30.0,22.0), data=Optional.absent()})
at com.github.rinde.rinsim.core.model.road.GraphRoadModelImpl.checkMoveValidity(GraphRoadModelImpl.java:241)
at com.github.rinde.rinsim.core.model.road.GraphRoadModelImpl.doFollowPath(GraphRoadModelImpl.java:169)
at com.github.rinde.rinsim.core.model.road.AbstractRoadModel.followPath(AbstractRoadModel.java:94)
at taxi.Taxi.delegate_mas_impl(Taxi.java:262)
at taxi.Taxi.tickImpl(Taxi.java:366)
at com.github.rinde.rinsim.core.model.pdp.Vehicle.tick(Vehicle.java:55)
at com.github.rinde.rinsim.core.model.time.TimeModel.tickImpl(TimeModel.java:139)
at com.github.rinde.rinsim.core.model.time.SimulatedTimeModel.doStart(SimulatedTimeModel.java:32)
at com.github.rinde.rinsim.core.model.time.TimeModel.start(TimeModel.java:94)
at com.github.rinde.rinsim.ui.SimulationViewer$5.run(SimulationViewer.java:401)