nachos.machine
Interface ElevatorControllerInterface

All Known Implementing Classes:
ElevatorController

public interface ElevatorControllerInterface
extends Runnable

A controller for all the elevators in an elevator bank. The controller accesses the elevator bank through an instance of ElevatorControls.


Field Summary
static int dirDown
          Indicates an elevator intends to move down.
static int dirNeither
          Indicates an elevator intends not to move.
static int dirUp
          Indicates an elevator intends to move up.
static int timeDoorsOpen
          The number of ticks doors should be held open before closing them.
 
Method Summary
 void initialize(ElevatorControls controls)
          Initialize this elevator controller.
 void run()
          Cause the controller to use the provided controls to receive and process requests from riders.
 

Field Detail

timeDoorsOpen

public static final int timeDoorsOpen
The number of ticks doors should be held open before closing them.

dirDown

public static final int dirDown
Indicates an elevator intends to move down.

dirNeither

public static final int dirNeither
Indicates an elevator intends not to move.

dirUp

public static final int dirUp
Indicates an elevator intends to move up.
Method Detail

initialize

public void initialize(ElevatorControls controls)
Initialize this elevator controller. The controller will access the elevator bank through controls. This constructor should return immediately after this controller is initialized, but not until the interupt handler is set. The controller will start receiving events after this method returns, but potentially before run() is called.
Parameters:
controls - the controller's interface to the elevator bank. The controller must not attempt to access the elevator bank in any other way.

run

public void run()
Cause the controller to use the provided controls to receive and process requests from riders. This method should not return, but instead should call controls.finish() when the controller is finished.
Specified by:
run in interface Runnable