/** * Defines a finite state machine * to wander around aimlessley. Note that * this does not really work very well * as higher priority behaviours * could occur in the middle of a sleep * which means that once the higher * priority behaviour terminates the * robot will continue on its last * trajectory. */ class Wander extends Task { public Wander() { actions = new Action[3]; actions[0] = new Action() { public int act() { setMotor(LEFT_MOTOR, 7, FORWARD); setMotor(RIGHT_MOTOR, 7, FORWARD); return 5000; } }; actions[1] = new Action() { public int act() { setMotor(LEFT_MOTOR, 3, FORWARD); setMotor(RIGHT_MOTOR, 7, FORWARD); return 2000; } }; actions[2] = new Action() { public int act() { setMotor(LEFT_MOTOR, 7, BACKWARD); setMotor(RIGHT_MOTOR, 7, FORWARD); return 700; } }; fsm = new int[3]; fsm[0] = 1; fsm[1] = 2; fsm[2] = 0; } }プログラムの流れを読むために,次のことを調べよ.