Commit eeaf9995 authored by Christina's avatar Christina
Browse files

treat group members as lost if broad obstacle in between

parent 21f47b99
Pipeline #860117 passed with stages
in 127 minutes and 4 seconds
......@@ -223,6 +223,14 @@ public class CentroidGroup implements Group {
return ret;
}
public boolean isCentroidWithinObstacle(){
// alternative: compute the centroid, loop through obstacles and check if shape.contains(centroid)
return getPairIntersectObstacle()
.stream().map(pedestrianPairBooleanPair -> pedestrianPairBooleanPair.getValue())
.anyMatch(val -> val);
}
public ArrayList<Pair<PedestrianPair, Boolean>> getPairIntersectObstacle(){
ArrayList<Pair<PedestrianPair, Boolean>> ret = new ArrayList<>(getPairCount());
......
......@@ -28,7 +28,11 @@ public class CentroidGroupSpeedAdjuster implements SpeedAdjuster {
// formular not completely the smae to seitz-2014 line 34 is 8/(delta +15) and not 8/(delta + 17)
if (!group.isLostMember(ped)) {
if (aheadDistance > 8) {
result = Double.MIN_VALUE;
if (!group.isCentroidWithinObstacle()){
result = Double.MIN_VALUE; // wait behavior
}
// else: do not wait, treat group member as "lost"
// holds if agents get seperated by obstacles broader 8[m]
} else if (aheadDistance >= 1) {
result /= 1.0 + aheadDistance / 8 - 1 / 8 + 1;
} else if (aheadDistance >= 0) {
......
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