[Psychology Layer] Add probabilistic perception model + [Post-vis] Fix footstep bug
Psychology Layer
Add a new perception model
Add probabilistic perception model.
The new model allows to assign a probability for each stimulus.
The default probability is p=1.0
.
p defines how likely it is that this stimulus is the most important stimulus.
If there are multiple stimuli defined, the sum of p_i must not exceed 1.
SimplePerceptionModel
to StimulusController
Move methods from Following methods have been moved:
selectClosestAndPerceptibleThreat(Pedestrian pedestrian, List<Stimulus> threatStimuli)
selectWaitInAreaContainingPedestrian(Pedestrian pedestrian, List<Stimulus> waitInAreaStimuli)
Why?
The StimulusController
provides a list of stimuli that is available for an agent. It acts like a filter.
In the old setting, the filtering was done in two steps:
-
- filter: time ->
StimulusController
- filter: time ->
-
- filter: space/proximity ( ->
WaitInArea
,Threat
) ->SimplePerceptionModel
In the old settings, this was suitable, because the stimulusController only provided stimuli that are perceived by all the agents. Since !162 (merged), the stimulusController also provides agent specific stimuli e.g. information that is received at different times. Therefore, I propose that the filtering is directly done in theStimulusController
:
- filter: space/proximity ( ->
-
- filter: time ->
StimulusController
- filter: time ->
-
- filter: space/proximity ( ->
WaitInArea
,Threat
) ->StimulusController
- filter: space/proximity ( ->
This has two advantages:
- The overall filtering is done in the same place. This avoids code duplication (if one adds a IPerceptionModel, they would need to inherit or copy the filtering algorithm from
SimplePerceptionModel
). - It simplifies the
SimplePerceptionModel
. Same behavior for all types of stimuli.
ControlModel
In the old setting, the ReactionModel
draw from a BernoulliDistribution (probability p) to decide whether a agent reacts or not.
What is new?
If the psyhchologylayer is used, the ReactionModel does not decide, but passes the probability to the stimulus.
Post-vis:
Bug: Agents disappeared in WAIT
mode.
If the last position is not set, pedestrian.getLastPosition()
provides a the origin.
It must be pedestrian.getPosition()
.