Commit 6ee10b90 authored by Benedikt Kleinmeier's avatar Benedikt Kleinmeier

In "CounterflowCognitionModel.java", imitate "SelfCategory.EVADE" if neighbor...

In "CounterflowCognitionModel.java", imitate "SelfCategory.EVADE" if neighbor is also "SelfCategory.EVADE"
parent 732a862f
Pipeline #273075 passed with stages
in 133 minutes and 56 seconds
......@@ -36,8 +36,12 @@ public class CounterflowCognitionModel implements ICognitionModel {
if (pedestrian.hasNextTarget()) {
Pedestrian closestPedestrian = getClosestPedestrianWhichIsCloserToTarget(pedestrian, topography);
if (closestPedestrian != null && walkingDirectionDiffers(pedestrian, closestPedestrian)) {
pedestrian.setSelfCategory(SelfCategory.EVADE);
if (closestPedestrian != null) {
if (walkingDirectionDiffers(pedestrian, closestPedestrian)) {
pedestrian.setSelfCategory(SelfCategory.EVADE);
} else if (closestPedestrian.getSelfCategory() == SelfCategory.EVADE) {
pedestrian.setSelfCategory(SelfCategory.EVADE); // Imitate behavior
}
}
}
}
......
......@@ -182,7 +182,9 @@ public class OSMBehaviorController {
VShape reachableArea = createCircularReachableAreaInEvasionDirection(pedestrian, evadeRight);
// TODO Only the colliding agents could evade tangentially.
// Other evading agents could follow the foremost evading agent.
// Other evading agents could follow the foremost evading agent by imitating SelfCategory.EVADE.
// TODO Use pedestrian.updateNextPosition(reachableArea) only and do not set position hard
// to avoid zig-zag trajectories.
if (topographyContainsReachableArea(topography, reachableArea)) {
pedestrian.setNextPosition(reachableArea.getCentroid());
} else {
......
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