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 1a477fa7 authored by Benedikt Kleinmeier's avatar Benedikt Kleinmeier
Browse files

Made code review with Bene and removed corresponding TODO comments.

parent 7cd01e55
Pipeline #107276 passed with stages
in 115 minutes and 4 seconds
......@@ -251,39 +251,10 @@ public class OSMBehaviorController {
makeStep(pedestrian1, topography, pedestrian1.getDurationNextStep());
makeStep(pedestrian2, topography, pedestrian2.getDurationNextStep());
// TODO Clarify with Bene if "stepDuration" should also be set
// and if "pedestrian2.timeOfNextStep()" should be also called.
// TODO The experiment showed that speed decreased (to half of free-flow velocity).
// Therefore, use "pedestrian.getDurationNextStep() * 2".
pedestrian1.setTimeOfNextStep(pedestrian1.getTimeOfNextStep() + pedestrian1.getDurationNextStep());
pedestrian2.setTimeOfNextStep(pedestrian2.getTimeOfNextStep() + pedestrian2.getDurationNextStep());
}
// TODO Remove debug method.
private void printDebugInfos(PedestrianOSM pedestrian1, PedestrianOSM pedestrian2) {
PedestrianOSM[] pedestrians = new PedestrianOSM[] { pedestrian1, pedestrian2 };
for (int i = 0; i < pedestrians.length; i++) {
PedestrianOSM currentPed = pedestrians[i];
System.out.println(String.format("Position %d: %s", currentPed.getId(), currentPed.getPosition()));
System.out.println(String.format("Trajectory %d: %s", currentPed.getId(), currentPed.getFootSteps()));
LinkedList<FootStep> currentFootsteps = currentPed.getFootSteps().getFootSteps();
if (currentFootsteps.size() >= 2) {
for (i = 1; i < currentFootsteps.size(); i++) {
FootStep previousFootstep = currentFootsteps.get(i - 1);
FootStep currentFootstep = currentFootsteps.get(i);
if (previousFootstep.getEndTime() > currentFootstep.getStartTime()) {
System.out.println(String.format(" Assertion failed (at index %d): previousEndTime > currentStartTime", i));
System.out.println(String.format(" %.2f -> %.2f (positions: %s -> %s)",
previousFootstep.getEndTime(), currentFootstep.getStartTime(),
previousFootstep.getEnd(), currentFootstep.getStart()
));
}
}
}
}
}
}
......@@ -59,7 +59,6 @@ public class UpdateSchemeEventDriven implements UpdateSchemeOSM {
pedestrian.setTimeOfNextStep(currentTimeInSec);
}
// TODO Make a code review with Bene here and check if everything works as expected.
if (pedestrian.getSalientBehavior() == SalientBehavior.TARGET_ORIENTED) {
// this can cause problems if the pedestrian desired speed is 0 (see speed adjuster)
pedestrian.updateNextPosition();
......
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