Modifier and Type | Field and Description |
---|---|
private MovementModule |
movementModel
The movement model.
|
private Position |
prevPos
Previous position for stuck detection.
|
private double |
timeSamePos
Stuck parameter.
|
Constructor and Description |
---|
StuckDetector(MovementModule movementModel)
Creates a stuck detector.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isStuck(boolean includeStopMoving,
double secondsStuck)
Determines if the agent is stuck for a given number of seconds.
|
boolean |
isStuck(double secondsStuck)
Determines if the agent is stuck for a given number of seconds.
|
void |
reset()
Resets the stuck detector.
|
void |
update(int timeStep)
Updates the stuck parameters.
|
private MovementModule movementModel
private double timeSamePos
private Position prevPos
public StuckDetector(MovementModule movementModel)
movementModel
- The movement model.public boolean isStuck(boolean includeStopMoving, double secondsStuck)
includeStopMoving
- Determines if the agent should be considered stuck if he has a
stop order.secondsStuck
- The number of seconds it takes before an agent is considered
stuck.public boolean isStuck(double secondsStuck)
secondsStuck
- The number of seconds it takes before an agent is considered
stuck.public void reset()