src/model/agent/Agent.java
public Action act() {
        log.finest(String.format("State: %s", state));

        Action action;
        switch (state) {
        case LOITERING:
            action = loiter();
            break;
        case MOVING:
            action = move();
            break;
        case STALKING:
            action = stalk();
            break;
        case THINKING:
            action = think();
            break;
        default:
            // disaster recovery
            setState(AgentState.THINKING);
            action = Action.WAIT;
            break;
        }

        // update wait counter
        if (action == Action.WAIT) {
            wait--;
        } else {
            wait = maxWait;
        }
        
        rounds++;
        
        return action;
    }
/**
     * Return an action for the model.
     */
Return an action for the model.
Return an action for the model .
public Action act() {
        log.finest(String.format("State: %s", state));
        Action action;
        switch (state) {
        case LOITERING:
            action = loiter();
            break;
        case MOVING:
            action = move();
            break;
        case STALKING:
            action = stalk();
            break;
        case THINKING:
            action = think();
            break;
        default:
            setState(AgentState.THINKING);
            action = Action.WAIT;
            break;
        }
        if (action == Action.WAIT) {
            wait--;
        } else {
            wait = maxWait;
        }
        rounds++;
        return action;
    }
public Action act ( ) { log . finest ( String . format ( "State: %s" , state ) ) ; Action action ; switch ( state ) { case LOITERING : action = loiter ( ) ; break ; case MOVING : action = move ( ) ; break ; case STALKING : action = stalk ( ) ; break ; case THINKING : action = think ( ) ; break ; default : setState ( AgentState . THINKING ) ; action = Action . WAIT ; break ; } if ( action == Action . WAIT ) { wait -- ; } else { wait = maxWait ; } rounds ++ ; return action ; }
Return an action for the model.
Return an action for the model .
// disaster recovery // update wait counter