org.jscience.architecture.lift.ca
Class BidirCollALLCA

java.lang.Object
  extended by org.jscience.architecture.lift.ca.BidirCollALLCA

public class BidirCollALLCA
extends java.lang.Object

This file is licensed under the GNU Public Licens (GPL).
This is a classic Bidirectional Collecting Autonomous Low Level Control Algorithm (ALLCA) that can be used in more sophisticated Call Allocators (CA).

See Also:
SimpleALLCA

Field Summary
static short BOTH_WAY
          Collecting both up and down calls.
protected  short Direction
          DOCUMENT ME!
static short DOWN_WAY
          Collecting down calls only.
static short UP_WAY
          Collecting up calls only.
 
Constructor Summary
BidirCollALLCA(Car MyCar)
          Constructor
 
Method Summary
 short getDirection()
          Gets the direction of the calls the ALLCA is currently collecting
 boolean getEnableCallCancellation()
          Gets the EnableCallCancellation attribute
 boolean getEnableNewCalls()
          Gets the EnableNewCalls attribute
 boolean goes(int From, int To)
          Returns true if and only if the Car is allowed to travel from floor From to floor To.
 void issueCommand(int AbsFloor)
          Issues a new command.
 void setEnableCallCancellation(boolean Value)
          Sets the EnableCallCancellation attribute
 void setEnableNewCalls(boolean Value)
          Sets the EnableNewCalls attribute
 void tick(boolean[] UpCalls, boolean[] DownCalls)
          This is the tick() that is called by a CA.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOTH_WAY

public static final short BOTH_WAY
Collecting both up and down calls.

See Also:
Constant Field Values

DOWN_WAY

public static final short DOWN_WAY
Collecting down calls only.

See Also:
Constant Field Values

UP_WAY

public static final short UP_WAY
Collecting up calls only.

See Also:
Constant Field Values

Direction

protected short Direction
DOCUMENT ME!

Constructor Detail

BidirCollALLCA

public BidirCollALLCA(Car MyCar)
Constructor

Parameters:
MyCar - The Car used by this class
Method Detail

setEnableNewCalls

public void setEnableNewCalls(boolean Value)
Sets the EnableNewCalls attribute

Parameters:
Value - DOCUMENT ME!

getEnableNewCalls

public boolean getEnableNewCalls()
Gets the EnableNewCalls attribute

Returns:
DOCUMENT ME!

setEnableCallCancellation

public void setEnableCallCancellation(boolean Value)
Sets the EnableCallCancellation attribute

Parameters:
Value - DOCUMENT ME!

getEnableCallCancellation

public boolean getEnableCallCancellation()
Gets the EnableCallCancellation attribute

Returns:
DOCUMENT ME!

getDirection

public short getDirection()
Gets the direction of the calls the ALLCA is currently collecting

Returns:
DOCUMENT ME!

goes

public boolean goes(int From,
                    int To)
Returns true if and only if the Car is allowed to travel from floor From to floor To. For example, if the Car has passengers inside and the passengers are going up, goes(From,To) should return false if From>To so that no new passenger tries to get in.

Parameters:
From - DOCUMENT ME!
To - DOCUMENT ME!
Returns:
true if and only if the Car is allowed to travel from From to To

issueCommand

public void issueCommand(int AbsFloor)
Issues a new command. This reflects that a passenger pushed a button.

Parameters:
AbsFloor - A destination as an Absolut Floor.

tick

public void tick(boolean[] UpCalls,
                 boolean[] DownCalls)
This is the tick() that is called by a CA.

Parameters:
UpCalls - The up calls that are planned to be served by this car.
DownCalls - The down calls that are planned to be served by this car.
Throws:
java.lang.RuntimeException - DOCUMENT ME!