org.jscience.architecture.lift
Class LoggerPassengerProcessor

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

public class LoggerPassengerProcessor
extends PassengerProcessor

This file is licensed under the GNU Public Licens (GPL).
This is a sample class (Quick, Dirty, Ineffective, but easy to understand) descendant of the abstract PassengerProcessor class. It logs some passenger information to files. You don't need to use this class as there is built-in logging in JLESA from version 0.2.0.

See Also:
LoadDependentKinematicModel

Constructor Summary
LoggerPassengerProcessor()
          Shortcut to this("GeneratedPassengers.log", "GeneratedPassengers.log", "GeneratedPassengers.log").
LoggerPassengerProcessor(java.lang.String GeneratedPassengersFile, java.lang.String PassengerTimesFile, java.lang.String QueuLengthsFile)
          Constructor (null parameters disable corresponding logging).
 
Method Summary
 void created(Passenger P)
          This method is called by World after each new Passenger generated.
 java.lang.String getName()
          Returns the Name of the object.
 java.lang.String getVersion()
          Returns the Version of the object
 void prepareToDie()
          This method is called by World before this Passengerprocessor is terminated.
 void process(Passenger P)
          This method is called by World before each Passenger terminated.
 void Tick()
          This function is called in each step of the simulator.
 
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
 

Constructor Detail

LoggerPassengerProcessor

public LoggerPassengerProcessor(java.lang.String GeneratedPassengersFile,
                                java.lang.String PassengerTimesFile,
                                java.lang.String QueuLengthsFile)
Constructor (null parameters disable corresponding logging).

Parameters:
GeneratedPassengersFile - Filename for logging the Passengers generated?
PassengerTimesFile - Filename for logging Passenger waiting and travel times?
QueuLengthsFile - Filename for logging the lengths of Passenger queus?

LoggerPassengerProcessor

public LoggerPassengerProcessor()
Shortcut to this("GeneratedPassengers.log", "GeneratedPassengers.log", "GeneratedPassengers.log").

Method Detail

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

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 PassengerProcessor
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 PassengerProcessor
Returns:
DOCUMENT ME!

created

public void created(Passenger P)
Description copied from class: PassengerProcessor
This method is called by World after each new Passenger generated.

Specified by:
created in class PassengerProcessor
Parameters:
P - DOCUMENT ME!

process

public void process(Passenger P)
Description copied from class: PassengerProcessor
This method is called by World before each Passenger terminated.

Specified by:
process in class PassengerProcessor
Parameters:
P - DOCUMENT ME!

prepareToDie

public void prepareToDie()
Description copied from class: PassengerProcessor
This method is called by World before this Passengerprocessor is terminated. "As a reaction, the instance of this object class should move and/or duplicate all non-temporary information to persistent databases". In other worlds, it should save everything important to disk.

Specified by:
prepareToDie in class PassengerProcessor