Commit ca5a2804 authored by Benedikt Kleinmeier's avatar Benedikt Kleinmeier
Browse files

In "OSMBehaviorController.wait()", call "makeStep()" to force that "EventTime"...

In "OSMBehaviorController.wait()", call "makeStep()" to force that "EventTime" output processors log psychology status properly
parent 1e4807f3
Pipeline #212802 failed with stages
in 1 minute and 46 seconds
......@@ -114,7 +114,11 @@ public class OSMBehaviorController {
pedestrian.setVelocity(new Vector2D(0, 0));
}
public void wait(PedestrianOSM pedestrian, double timeStepInSec) {
public void wait(PedestrianOSM pedestrian, Topography topography, double timeStepInSec) {
// Force a "FootStep" so that output processor can log psychology status even if pedestrian did not change position.
// TODO: Maybe, "getDurationNextStep()" must be adapted to avoid that
// start time of this step <= end time previous step
makeStep(pedestrian, topography, timeStepInSec);
// Satisfy event-driven and sequential update scheme.
pedestrian.setTimeOfNextStep(pedestrian.getTimeOfNextStep() + timeStepInSec);
}
......
......@@ -69,7 +69,7 @@ public class UpdateSchemeEventDriven implements UpdateSchemeOSM {
osmBehaviorController.changeTargetToSafeZone(pedestrian, topography);
osmBehaviorController.makeStepToTarget(pedestrian, topography);
} else if (selfCategory == SelfCategory.WAIT) {
osmBehaviorController.wait(pedestrian, timeStepInSec);
osmBehaviorController.wait(pedestrian, topography, timeStepInSec);
} else if (selfCategory == SelfCategory.CHANGE_TARGET) {
osmBehaviorController.changeTarget(pedestrian, topography);
}
......
......@@ -65,7 +65,7 @@ public class UpdateSchemeSequential implements UpdateSchemeOSM {
osmBehaviorController.changeTargetToSafeZone(pedestrian, topography);
stepForward(pedestrian, currentTimeInSec, timeStepInSec);
} else if (selfCategory == SelfCategory.WAIT) {
osmBehaviorController.wait(pedestrian, timeStepInSec);
osmBehaviorController.wait(pedestrian, topography, timeStepInSec);
} else if (selfCategory == SelfCategory.CHANGE_TARGET) {
osmBehaviorController.changeTarget(pedestrian, topography);
}
......
......@@ -78,7 +78,7 @@ public class UpdateSchemeEventDriven implements DynamicElementAddListener, Dynam
osmBehaviorController.changeTargetToSafeZone(pedestrian, topography);
osmBehaviorController.makeStepToTarget(pedestrian, topography);
} else if (selfCategory == SelfCategory.WAIT) {
osmBehaviorController.wait(pedestrian, timeStepInSec);
osmBehaviorController.wait(pedestrian, topography, timeStepInSec);
} else if (selfCategory == SelfCategory.CHANGE_TARGET) {
osmBehaviorController.changeTarget(pedestrian, topography);
}
......
Supports Markdown
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