Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
9.2.2023: Due to updates GitLab will be unavailable for some minutes between 9:00 and 11:00.
Open sidebar
vadere
vadere
Commits
823c1d83
Commit
823c1d83
authored
Apr 09, 2019
by
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
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
VadereSimulator/src/org/vadere/simulator/control/cognition/SalientBehaviorCognition.java
View file @
823c1d83
...
...
@@ -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
);
}
}
...
...
VadereSimulator/src/org/vadere/simulator/models/osm/OSMBehaviorController.java
View file @
823c1d83
...
...
@@ -110,7 +110,7 @@ public class OSMBehaviorController {
* Carry out the following steps:
*
* <ol>
* <li>Use topography to find a close
st P
edestrian within step circle which is closer to target than the given pedestrian.</li>
* <li>Use topography to find a close
p
edestrian 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
)
{
...
...
VadereSimulator/src/org/vadere/simulator/models/osm/updateScheme/UpdateSchemeEventDriven.java
View file @
823c1d83
...
...
@@ -58,18 +58,18 @@ public class UpdateSchemeEventDriven implements UpdateSchemeOSM {
if
(
pedestrian
.
getTimeOfNextStep
()
==
0
)
{
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
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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