Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
085927e5
Commit
085927e5
authored
Oct 25, 2019
by
Benedikt Kleinmeier
Browse files
In "OSMBehaviorController", deleted obsolete code "swapWithClosestCooperativePedestrian()"
parent
d5c45be1
Changes
1
Hide whitespace changes
Inline
Side-by-side
VadereSimulator/src/org/vadere/simulator/models/osm/OSMBehaviorController.java
View file @
085927e5
...
...
@@ -128,64 +128,6 @@ public class OSMBehaviorController {
}
}
/**
* Try to swap the given pedestrian with the closest cooperative pedestrian.
* Carry out the following steps:
*
* TODO: Refactoring, this class should not have access to the event queue. Idea: use "old" events which will be ignored i.e.
* one agent might have multiple events in the queue.
*
* <ol>
* <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>
* </ol>
*
* @param pedestrian The pedestrian which would like to swap the position.
* @param topography The topography is required to find the neighbors of the given pedestrian.
*/
/*public void swapWithClosestCooperativePedestrian(PedestrianOSM pedestrian, Topography topography, PriorityQueue<PedestrianOSM> queue) {
if (pedestrian.hasNextTarget() == false) { // Ignore pedestrians with no targets.
// this can cause problems if the pedestrian desired speed is 0 (see speed adjuster)
pedestrian.updateNextPosition();
makeStep(pedestrian, topography, pedestrian.getDurationNextStep());
pedestrian.setTimeOfNextStep(pedestrian.getTimeOfNextStep() + pedestrian.getDurationNextStep());
return;
}
List<Pedestrian> closestPedestrians = getClosestPedestriansWhichAreCloserToTarget(pedestrian, topography);
boolean pedestriansSwapped = false;
if (closestPedestrians.size() > 0) {
for (Pedestrian closestPedestrian : closestPedestrians) {
boolean closestPedIsCooperative = closestPedestrian.getSalientBehavior() == SalientBehavior.COOPERATIVE;
boolean targetOrientationDiffers = false;
// TODO: Compare both approaches.
double angleInRadian = calculateAngleBetweenTargets(pedestrian, closestPedestrian, topography);
// double angleInRadian = angleInRadian = calculateAngleBetweenTargetGradients(pedestrian, (PedestrianOSM)closestPedestrian);
if (angleInRadian == -1 || Math.toDegrees(angleInRadian) > pedestrian.getAttributes().getTargetOrientationAngleThreshold()) {
targetOrientationDiffers = true;
}
if (closestPedIsCooperative && targetOrientationDiffers) {
swapPedestrians(pedestrian, (PedestrianOSM)closestPedestrian, topography, queue);
pedestriansSwapped = true;
break;
}
}
}
if (pedestriansSwapped == false) { // Try to perform a regular step
// this can cause problems if the pedestrian desired speed is 0 (see speed adjuster)
pedestrian.updateNextPosition();
makeStep(pedestrian, topography, pedestrian.getDurationNextStep());
pedestrian.setTimeOfNextStep(pedestrian.getTimeOfNextStep() + pedestrian.getDurationNextStep());
}
}*/
@Nullable
public
PedestrianOSM
findSwapCandidate
(
PedestrianOSM
pedestrian
,
Topography
topography
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment