Notice to GitKraken users: A vulnerability has been found in the SSH key generation of GitKraken versions 7.6.0 to 8.0.0 (https://www.gitkraken.com/blog/weak-ssh-key-fix). If you use GitKraken and have generated a SSH key using one of these versions, please remove it both from your local workstation and from your LRZ GitLab profile.

21.10.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 1a099655 authored by Benedikt Kleinmeier's avatar Benedikt Kleinmeier
Browse files

In "OSMBehaviorController.swapPedestrians()", fixed bug...

In "OSMBehaviorController.swapPedestrians()", fixed bug ("pedestrian1.setTimeOfNextStep()" was not called).
parent 1975891b
Pipeline #106263 failed with stages
in 62 minutes and 51 seconds
...@@ -240,15 +240,9 @@ public class OSMBehaviorController { ...@@ -240,15 +240,9 @@ public class OSMBehaviorController {
} }
private void swapPedestrians(PedestrianOSM pedestrian1, PedestrianOSM pedestrian2, Topography topography) { private void swapPedestrians(PedestrianOSM pedestrian1, PedestrianOSM pedestrian2, Topography topography) {
// TODO Revise code to avoid AssertionError in VTrajectory.java:110
// at org.vadere.state.simulation.VTrajectory.add(VTrajectory.java:110)
// at org.vadere.simulator.models.osm.OSMBehaviorController.makeStep(OSMBehaviorController.java:79)
// at org.vadere.simulator.models.osm.OSMBehaviorController.swapPedestrians(OSMBehaviorController.java:250)
// This error arises because one agent makes two steps within one update step and step duration or something else is wrong.
VPoint newPosition = pedestrian2.getPosition().clone(); VPoint newPosition = pedestrian2.getPosition().clone();
VPoint oldPosition = pedestrian1.getPosition().clone(); VPoint oldPosition = pedestrian1.getPosition().clone();
// TODO Set also "timeOfNextStep" and "stepDuration" proberly.
pedestrian1.setNextPosition(newPosition); pedestrian1.setNextPosition(newPosition);
pedestrian2.setNextPosition(oldPosition); pedestrian2.setNextPosition(oldPosition);
...@@ -257,9 +251,12 @@ public class OSMBehaviorController { ...@@ -257,9 +251,12 @@ public class OSMBehaviorController {
makeStep(pedestrian1, topography, pedestrian1.getDurationNextStep()); makeStep(pedestrian1, topography, pedestrian1.getDurationNextStep());
makeStep(pedestrian2, topography, pedestrian2.getDurationNextStep()); makeStep(pedestrian2, topography, pedestrian2.getDurationNextStep());
printDebugInfos(pedestrian1, pedestrian2); // TODO Clarify with Bene if "stepDuration" should also be set
// and if "pedestrian2.timeOfNextStep()" should be also called.
pedestrian1.setTimeOfNextStep(pedestrian1.getTimeOfNextStep() + pedestrian1.getDurationNextStep());
} }
// TODO Remove debug method.
private void printDebugInfos(PedestrianOSM pedestrian1, PedestrianOSM pedestrian2) { private void printDebugInfos(PedestrianOSM pedestrian1, PedestrianOSM pedestrian2) {
PedestrianOSM[] pedestrians = new PedestrianOSM[] { pedestrian1, pedestrian2 }; PedestrianOSM[] pedestrians = new PedestrianOSM[] { pedestrian1, pedestrian2 };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment