org.jscience.architecture.lift.ca
Class DynZoneCA

java.lang.Object
  extended by org.jscience.architecture.lift.ca.DynZoneCA
All Implemented Interfaces:
CA

public class DynZoneCA
extends java.lang.Object
implements CA

This file is licensed under the GNU Public Licens (GPL).
This is nice Dynamic Zoning CA that uses a SimpleALLCA for each Car and has a pretty informative GUI.


Field Summary
 int[] DownMasks
          DownMask[i]==n if and only if the down calls on floor i are allocated to SimpleALLCA[n]
 int[] UpMasks
          DownMask[i]==n if and only if the up calls on floor i are allocated to SimpleALLCA[n]
 
Constructor Summary
DynZoneCA(boolean hasGUI)
          Constructor
 
Method Summary
 int getDirection(int CarIndex)
          Returns the Direction of the CarIndexth Car
 boolean goes(int From, int To, int CarIndex)
          Forwards the request to the corresponding SimpleALLCA
 void issueCommand(Car CC, int AbsFloor)
          Forwards the request to the corresponding SimpleALLCA
 void tick()
          Tickable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DownMasks

public int[] DownMasks
DownMask[i]==n if and only if the down calls on floor i are allocated to SimpleALLCA[n]


UpMasks

public int[] UpMasks
DownMask[i]==n if and only if the up calls on floor i are allocated to SimpleALLCA[n]

Constructor Detail

DynZoneCA

public DynZoneCA(boolean hasGUI)
Constructor

Parameters:
hasGUI - true if a GUI is required
Method Detail

goes

public boolean goes(int From,
                    int To,
                    int CarIndex)
Forwards the request to the corresponding SimpleALLCA

Specified by:
goes in interface CA
Parameters:
From - DOCUMENT ME!
To - DOCUMENT ME!
CarIndex - DOCUMENT ME!
Returns:
DOCUMENT ME!
See Also:
CA, SimpleALLCA

issueCommand

public void issueCommand(Car CC,
                         int AbsFloor)
Forwards the request to the corresponding SimpleALLCA

Specified by:
issueCommand in interface CA
Parameters:
CC - DOCUMENT ME!
AbsFloor - DOCUMENT ME!
Throws:
java.lang.RuntimeException - DOCUMENT ME!
See Also:
CA, SimpleALLCA

tick

public void tick()
Tickable

Specified by:
tick in interface CA

getDirection

public int getDirection(int CarIndex)
Returns the Direction of the CarIndexth Car

Parameters:
CarIndex - DOCUMENT ME!
Returns:
DOCUMENT ME!