org.jscience.architecture.lift
Class World

java.lang.Object
  extended by org.jscience.architecture.lift.Tickable
      extended by org.jscience.architecture.lift.World
All Implemented Interfaces:
TickableInterface

public class World
extends Tickable

This file is licensed under the GNU Public Licens (GPL).
This foundation class is the World that contains almost everything else. GUIs are not part of the World so that JLESA can work in a command-line.


Field Summary
static int MaximumNumberOfTicks
          Maximum number of Ticks before stopping.
 
Constructor Summary
World(int MinFloor, int MaxFloor)
          Constructor a new World, with (NewMinFloor,MaxFloorm-1)
World(int MinFloor, int MaxFloor, int ConfigFileID)
          Constructor a new World.
 
Method Summary
 void add(Car TC)
          Adds the TCCar to the World.
static void add(Passenger TP)
          Adds the TPPassenger to the World.
 void add(PassengerGenerator PG)
          Adds the PGPassengerGenerator to the World.
 void add(PassengerProcessor PP)
          Adds the PPPassengerProcessor to the World.
static void deleteCorrespongingCalls(Car C)
          Deletes all calls that are available on CCar's indicator.
static CA getCA()
          Returns the current CA.
static Car getCar(int Index)
          Returns the Indexth Car.
static Car[] getCars()
          Returns all Cars in an Array.
static int getIndexOfCar(Car C)
          Returns the Index of the CCar.
static InOutput getInput(int Index)
          Returns the Indexth Input ( which is really a InOutput).
static InOutput[] getInputs()
          Returns all the Inputs ( which are really InOutputs).
static java.util.logging.Logger getLogger()
          Returns the Logger of the World
static int getMaxF()
          Returns the highest floor
static int getMinF()
          Returns the lowest floor
 java.lang.String getName()
          Returns the Name of the object.
static int getNoC()
          Returns the number of Cars.
static int getNoF()
          Returns the number of floors.
static int getNumberOfPassengers(int Floor)
          Returns the number of Passengers on floor Floor.
static InOutput[] getOutputs(int AbsFloor)
          Returns all the Outputs (which are really InOutputs) on the AbsFloorth floor
static int[] getPassengerDstFloorsInCar(Car C)
          Returns the destination floors of the Passengers in CarC
static java.util.ArrayList getPassengers(int Floor)
          Returns the Passengers on floor Floor.
static java.util.ArrayList getPassengersGettingOutAtFloor(int AbsFloor)
          Returns the Passengers getting out on floor Floor.
static java.util.ArrayList getPassengersInCar(Car C)
          Returns the Passengers in CarC.
static int getTotalTicks()
          Returns the total number of ticks so long.
 java.lang.String getVersion()
          Returns the Version of the object
static boolean isBlocked(Car C)
          Returns true if the CCar is blocked (due to Passengers).
static void letPassengersToSignal()
          Lets the Passengers signal.
static void remove(Passenger TP)
          Removes the finished TPPassenger from the World after processing it through all added PassengerProcessors.
protected  void setCA(CA NewCA)
          Sets the World's CA to NewCA.
 void Tick()
          This function is called in each step of the simulator.
 boolean Tick(int TN)
          Equivalent of TN pieces of Tick()
static int toAbsFloor(int RelFloor)
          Converts RelFloor to AbsFloor
static int toRelFloor(int AbsFloor)
          Converts AbsFloor to RelFloor
 
Methods inherited from class org.jscience.architecture.lift.Tickable
getFullName, getID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MaximumNumberOfTicks

public static int MaximumNumberOfTicks
Maximum number of Ticks before stopping.

Constructor Detail

World

public World(int MinFloor,
             int MaxFloor)
Constructor a new World, with (NewMinFloor,MaxFloorm-1)


World

public World(int MinFloor,
             int MaxFloor,
             int ConfigFileID)
Constructor a new World.

Parameters:
MinFloor - Lowest floor
MaxFloor - Highest floor
ConfigFileID - The ID of the translation/config file to use
Method Detail

isBlocked

public static boolean isBlocked(Car C)
Returns true if the CCar is blocked (due to Passengers).

Parameters:
C - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.RuntimeException - DOCUMENT ME!

getCA

public static CA getCA()
Returns the current CA.

Returns:
DOCUMENT ME!

getCar

public static Car getCar(int Index)
Returns the Indexth Car.

Parameters:
Index - DOCUMENT ME!
Returns:
DOCUMENT ME!

getCars

public static Car[] getCars()
Returns all Cars in an Array.

Returns:
DOCUMENT ME!

getIndexOfCar

public static int getIndexOfCar(Car C)
Returns the Index of the CCar.

Parameters:
C - DOCUMENT ME!
Returns:
DOCUMENT ME!

getInput

public static InOutput getInput(int Index)
Returns the Indexth Input ( which is really a InOutput).

Parameters:
Index - DOCUMENT ME!
Returns:
DOCUMENT ME!

getInputs

public static InOutput[] getInputs()
Returns all the Inputs ( which are really InOutputs).

Returns:
DOCUMENT ME!

getLogger

public static java.util.logging.Logger getLogger()
Returns the Logger of the World

Returns:
DOCUMENT ME!

getMaxF

public static int getMaxF()
Returns the highest floor

Returns:
DOCUMENT ME!

getMinF

public static int getMinF()
Returns the lowest floor

Returns:
DOCUMENT ME!

getName

public java.lang.String getName()
Description copied from interface: TickableInterface
Returns the Name of the object.

Specified by:
getName in interface TickableInterface
Specified by:
getName in class Tickable
Returns:
DOCUMENT ME!

getNoC

public static int getNoC()
Returns the number of Cars.

Returns:
DOCUMENT ME!

getNoF

public static int getNoF()
Returns the number of floors.

Returns:
DOCUMENT ME!

getNumberOfPassengers

public static int getNumberOfPassengers(int Floor)
Returns the number of Passengers on floor Floor.

Parameters:
Floor - DOCUMENT ME!
Returns:
DOCUMENT ME!

getOutputs

public static InOutput[] getOutputs(int AbsFloor)
Returns all the Outputs (which are really InOutputs) on the AbsFloorth floor

Parameters:
AbsFloor - DOCUMENT ME!
Returns:
DOCUMENT ME!

getPassengerDstFloorsInCar

public static int[] getPassengerDstFloorsInCar(Car C)
Returns the destination floors of the Passengers in CarC

Parameters:
C - DOCUMENT ME!
Returns:
DOCUMENT ME!

getPassengers

public static java.util.ArrayList getPassengers(int Floor)
Returns the Passengers on floor Floor.

Parameters:
Floor - DOCUMENT ME!
Returns:
DOCUMENT ME!

getPassengersGettingOutAtFloor

public static java.util.ArrayList getPassengersGettingOutAtFloor(int AbsFloor)
Returns the Passengers getting out on floor Floor.

Parameters:
AbsFloor - DOCUMENT ME!
Returns:
DOCUMENT ME!

getPassengersInCar

public static java.util.ArrayList getPassengersInCar(Car C)
Returns the Passengers in CarC.

Parameters:
C - DOCUMENT ME!
Returns:
DOCUMENT ME!

getTotalTicks

public static int getTotalTicks()
Returns the total number of ticks so long.

Returns:
DOCUMENT ME!

getVersion

public java.lang.String getVersion()
Description copied from interface: TickableInterface
Returns the Version of the object

Specified by:
getVersion in interface TickableInterface
Specified by:
getVersion in class Tickable
Returns:
DOCUMENT ME!

Tick

public void Tick()
Description copied from interface: TickableInterface
This function is called in each step of the simulator. In other words, this method is called whenever a discrete simulation step (0.1 second) happens. All objects that are time-variant is notified by this method that some time has elapsed since.

Specified by:
Tick in interface TickableInterface
Specified by:
Tick in class Tickable

Tick

public boolean Tick(int TN)
Equivalent of TN pieces of Tick()

Parameters:
TN - DOCUMENT ME!
Returns:
DOCUMENT ME!

add

public static void add(Passenger TP)
Adds the TPPassenger to the World.

Parameters:
TP - DOCUMENT ME!
Throws:
java.lang.RuntimeException - DOCUMENT ME!

add

public void add(Car TC)
Adds the TCCar to the World.

Parameters:
TC - DOCUMENT ME!
Throws:
java.lang.RuntimeException - DOCUMENT ME!

add

public void add(PassengerGenerator PG)
Adds the PGPassengerGenerator to the World.

Parameters:
PG - DOCUMENT ME!
Throws:
java.lang.RuntimeException - DOCUMENT ME!

add

public void add(PassengerProcessor PP)
Adds the PPPassengerProcessor to the World.

Parameters:
PP - DOCUMENT ME!
Throws:
java.lang.RuntimeException - DOCUMENT ME!

deleteCorrespongingCalls

public static void deleteCorrespongingCalls(Car C)
Deletes all calls that are available on CCar's indicator. This usually happens when a Car arrives to a floor.

Parameters:
C - DOCUMENT ME!
Throws:
java.lang.RuntimeException - DOCUMENT ME!

letPassengersToSignal

public static void letPassengersToSignal()
Lets the Passengers signal.


remove

public static void remove(Passenger TP)
Removes the finished TPPassenger from the World after processing it through all added PassengerProcessors.

Parameters:
TP - DOCUMENT ME!
Throws:
java.lang.RuntimeException - DOCUMENT ME!

toAbsFloor

public static int toAbsFloor(int RelFloor)
Converts RelFloor to AbsFloor

Parameters:
RelFloor - DOCUMENT ME!
Returns:
DOCUMENT ME!

toRelFloor

public static int toRelFloor(int AbsFloor)
Converts AbsFloor to RelFloor

Parameters:
AbsFloor - DOCUMENT ME!
Returns:
DOCUMENT ME!

setCA

protected void setCA(CA NewCA)
Sets the World's CA to NewCA.

Parameters:
NewCA - DOCUMENT ME!