Commit 823c1d83 authored by Benedikt Kleinmeier's avatar Benedikt Kleinmeier
Browse files

In "UpdateSchemeEventDriven", added TODO for code review with Bene.

parent 95f121e8
Pipeline #104103 passed with stages
in 119 minutes and 3 seconds
......@@ -42,6 +42,7 @@ public class SalientBehaviorCognition {
if (lastFootSteps.getAverageSpeedInMeterPerSecond() <= requiredSpeedInMetersPerSecondToBeCooperative) {
pedestrian.setSalientBehavior(SalientBehavior.COOPERATIVE);
} else {
// TODO Maybe, check if area directed to target is free for a step (only then change to "TARGET_ORIENTED").
pedestrian.setSalientBehavior(SalientBehavior.TARGET_ORIENTED);
}
}
......
......@@ -110,7 +110,7 @@ public class OSMBehaviorController {
* Carry out the following steps:
*
* <ol>
* <li>Use topography to find a closest Pedestrian within step circle which is closer to target than the given pedestrian.</li>
* <li>Use topography to find a close pedestrian within step circle which is closer to target than the given pedestrian.</li>
* <li>Check if candidate is SalientBehavior.COOPERATIVE.</li>
* <li>Check if target orientation of candidate differs from own orientation.</li>
* <li>Swap if checks (2) and (3) are true.</li>
......@@ -129,7 +129,7 @@ public class OSMBehaviorController {
if (closestPedestrians.size() > 0) {
for (Pedestrian closestPedestrian : closestPedestrians) {
boolean closestPedIsCooperative = closestPedestrian.getSalientBehavior() == SalientBehavior.COOPERATIVE;
// TODO Implement helper method to analyze target orientation.
// TODO Use method "calculateAngleBetweenTargets()" to decide if target orientation of both pedestrians differs.
boolean targetOrientationDiffers = true;
if (closestPedIsCooperative && targetOrientationDiffers) {
......
......@@ -59,17 +59,17 @@ public class UpdateSchemeEventDriven implements UpdateSchemeOSM {
pedestrian.setTimeOfNextStep(currentTimeInSec);
}
// TODO Make a code review with Bene here and check if everything works as expected.
// this can cause problems if the pedestrian desired speed is 0 (see speed adjuster)
pedestrian.updateNextPosition();
double stepDuration = pedestrian.getDurationNextStep();
// TODO Revise following quick-and-dirty code.
osmBehaviorController.makeStep(pedestrian, topography, stepDuration);
pedestrian.setTimeOfNextStep(pedestrian.getTimeOfNextStep() + stepDuration);
if (pedestrian.getSalientBehavior() == SalientBehavior.COOPERATIVE) {
osmBehaviorController.swapWithClosestCooperativePedestrian(pedestrian, topography);
}
osmBehaviorController.makeStep(pedestrian, topography, stepDuration);
pedestrian.setTimeOfNextStep(pedestrian.getTimeOfNextStep() + stepDuration);
} else if (mostImportantEvent instanceof WaitEvent || mostImportantEvent instanceof WaitInAreaEvent) {
osmBehaviorController.wait(pedestrian);
} else if (mostImportantEvent instanceof BangEvent) {
......
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