Simulator/src/model/agent/humanAgent/aatom/tacticalLevel/navigation/NavigationModule.java
/**
	 * Handles the behavior if the agent gets stuck.
	 * 
	 * @param timeStep
	 *            The time step.
	 */
Handles the behavior if the agent gets stuck.

@param timeStep
The time step.
Handles the behavior if the agent gets stuck . @param timeStep The time step .
protected void handleStuckBehavior(int timeStep) {
		stuckDetector.update(timeStep);
		if (isQueuing()) {
			if (stuckDetector.isStuck(false, 120)) {
				setGoal(getQueueGoal());
				stuckDetector.reset();
			}
		}
		if (stuckDetector.isStuck(20)) {
			if (getGoalPosition().equals(Position.NO_POSITION) && activityModule.getActiveActivity() == null) {
				setGoal(activityModule.getNextActivityPosition());
				stuckDetector.reset();
			} else if (getGoalPositions().size() > 0) {
				setGoal(getGoalPositions().get(getGoalPositions().size() - 1));
				if (!inQueuingArea()) {
					setShortTermGoal(
							new Position(movementModel.getPosition().x + Utilities.RANDOM_GENERATOR.nextDouble() - 0.5,
									movementModel.getPosition().y + Utilities.RANDOM_GENERATOR.nextDouble() - 0.5));
				}
				stuckDetector.reset();
			}
		}
	}
protected void handleStuckBehavior ( int timeStep ) { stuckDetector . update ( timeStep ) ; if ( isQueuing ( ) ) { if ( stuckDetector . isStuck ( false , 120 ) ) { setGoal ( getQueueGoal ( ) ) ; stuckDetector . reset ( ) ; } } if ( stuckDetector . isStuck ( 20 ) ) { if ( getGoalPosition ( ) . equals ( Position . NO_POSITION ) && activityModule . getActiveActivity ( ) == null ) { setGoal ( activityModule . getNextActivityPosition ( ) ) ; stuckDetector . reset ( ) ; } else if ( getGoalPositions ( ) . size ( ) > 0 ) { setGoal ( getGoalPositions ( ) . get ( getGoalPositions ( ) . size ( ) - 1 ) ) ; if ( ! inQueuingArea ( ) ) { setShortTermGoal ( new Position ( movementModel . getPosition ( ) . x + Utilities . RANDOM_GENERATOR . nextDouble ( ) - 0.5 , movementModel . getPosition ( ) . y + Utilities . RANDOM_GENERATOR . nextDouble ( ) - 0.5 ) ) ; } stuckDetector . reset ( ) ; } } }
Handles the behavior if the agent gets stuck.
Handles the behavior if the agent gets stuck .
// if queuing, go to front of queue // if stuck, go to next activity OR current goal