[Simulator] TargetController handleArrivingAgent cannot handle any number of parallel events
Summary
Agents get stuck when targets with a disabled absorber and enabled waiter are introduced. This is probably due to two errors:
- the default value for
leavingSpeed
is 0 instead of -1 (see issue #358 (closed)) - the default value for
parallelEvents
is 0 as intended but the simulation does not yield the expected behavior, i.e. target processes any/inf number of agents at the same time - batch processing is not working -> one can use stimuli
What is the current bug behavior?
- Agents get stuck at intermediate targets if
parallelEvents
equals 0 - Agents get stuck at intermediate targets if
parallelEvents
is greater than the number of agents arriving at the target (e.g. x agents are spawned in the simulation, parallel events is set to a number > x)
What is the expected correct behavior?
- Any/inf number of agents should be processed in parallel when
parallelEvents
is set to 0. - Waiting process should start if the number of agents that have arrived at the target is less or equal to
parallelEvents
(e.g. x + 1 agents approach a target, the target allows x parallel events; then, x agents wait (individually) until their waiting time is over; as soon as one agent has reached the waiting time, agent number x+1 can enter the waiting process)
Steps to reproduce
Create a new scenario, add an intermediate target with the following attributes:
...
"absorber" : {
"enabled" : false,
"deletionDistance" : 0.1
},
"waiter" : {
"enabled" : true,
"distribution" : {
"type" : "org.vadere.state.attributes.distributions.AttributesConstantDistribution",
"updateFrequency" : 10.0
}
},
"leavingSpeed" : -1.0,
"parallelEvents" : 0
}
Run the simulation.
Or run any scenario from vadere\Scenarios that involves intermediate targets with default settings, e.g. vadere\Scenarios\Demos\supermarket\scenarios\supermarket_basic.scenario
Starting point
- Probably something wrong with handleArrivingAgent in TargetController