com.azalient.api.a
Interface ISimulator


public interface ISimulator

The (single) simulator object contains references to control and query the simulation


Nested Class Summary
static class ISimulator.SimulationPhase
          An enumeration of phases within the main simulation loop
 
Method Summary
 void addAgentEventListener(AgentEvent ev, SimulationEventListener ael)
          [INTERNAL] Call this to add a listener for agent events.
 void addAttached(IAttached a)
          [INTERNAL]
 void addInternalListeners()
          [INTERNAL]
 void addModelEventListener(ModelEvent ev, SimulationEventListener mel)
          [INTERNAL] Call this to add a listener for model events.
 void addPassenger(IPassenger a)
          [INTERNAL]
 void addPerson(IPerson a)
          [INTERNAL]
 void addTransport(ITransport a)
          [INTERNAL]
 void addVehicle(IVehicle a)
          [INTERNAL]
 boolean agentEvent(IAgent agent, AgentEvent event, Object data)
          [INTERNAL] Call an agent-type event, with the given agent and data
 IAttached[] attached()
          An array of all attachments currently travelling
 boolean batchMode()
          Returns true if the simulator is running in batch model
 void callPriority(Object event, Object basePlugin, CallOrder pri)
          [INTERNAL]
 void clearAgents()
          Destroy all people and vehicles
 void clearInternalListeners()
          [INTERNAL]
 ISimulatorControl control()
          The simulator control object, providing stop/start functionality, etc
 void finished(Object a)
          [INTERNAL]
 void fixedTimeSignals(boolean operating)
          [INTERNAL]
 Object internalEventListener()
           
 boolean modelEvent(ModelEvent event, Object data)
          [INTERNAL] Call a model-type event, with the given data
 IPassenger[] passengers()
          An array of all passengers currently travelling (not yet successfully arrived)
 IStore<IPassenger> passengers(boolean all)
          A store object containing all current and past transport passengers, if 'all' is set, or only current passengers, if 'all' is false
 IPerson[] persons()
          An array of all people currently travelling (not yet successfully arrived)
 IStore<IPerson> persons(boolean all)
          A store object containing all people.
 ISimulator.SimulationPhase phase()
          The current phase within the simulation loop
 IPluginLoader pluginLoader()
          [INTERNAL] A handle to the object that loads and unloads plugins
 void postOpen()
          [INTERNAL]
 void postRenew()
          [INTERNAL]
 void removeSimulationEventListener(SimulationEventListener sel)
          call this to remove a simulation event listener from list of agent and model event listeners
 void renew(String scenarioName)
          [INTERNAL] Call before renewing model (re-open file)
 boolean running()
          Returns true if the simulator is currently running (play button is pressed)
 void running(boolean isRunning)
          Set the running state, equivalent to a press on the play/pause button
 boolean simulationComplete()
          Returns true if the simulator has reached the end of the simulation term
 DayOfWeek simulationDay()
          Return the day of week of this simulation model run.
 double simulationTime()
          The current simulation time, in seconds
 void simulationTime(double t)
          [INTERNAL] Set the current simulation time
 double startTime()
          A convenience method to return the start of the simulation term, in seconds.
 void timeStep(double now, double interval)
          Set the simulation time interval
 int totalAgents()
          Return the total number of people and vehicles currently in the model - those that have departed but not yet arrived.
 int totalPeople()
          Return the total number of people and vehicles currently in the model - those that have departed but not yet arrived.
 int totalTransports()
          Return the total number of transports currently in the model - those that have departed but not yet arrived.
 int totalVehicles()
          Return the total number vehicles currently in the model - those moving between origin and destination, and those parked.
 int totalVehiclesParked()
          Return the total number of parked vehicles the model.
 ITransport[] transports()
          An array of all transports currently travelling (not yet successfully arrived)
 IStore<ITransport> transports(boolean all)
          A store object containing all current and past transport vehicles, if 'all' is set, or only current transports, if 'all' is false
 IVehicle[] vehicles()
          An array of all vehicles currently travelling (not yet successfully arrived)
 IStore<IVehicle> vehicles(boolean all)
          A store object containing all vehicles.
 

Method Detail

phase

ISimulator.SimulationPhase phase()
The current phase within the simulation loop


control

ISimulatorControl control()
The simulator control object, providing stop/start functionality, etc


persons

IStore<IPerson> persons(boolean all)
A store object containing all people. The 'all' flag is now deprecated.


vehicles

IStore<IVehicle> vehicles(boolean all)
A store object containing all vehicles. The 'all' flag is now deprecated.


transports

IStore<ITransport> transports(boolean all)
A store object containing all current and past transport vehicles, if 'all' is set, or only current transports, if 'all' is false


passengers

IStore<IPassenger> passengers(boolean all)
A store object containing all current and past transport passengers, if 'all' is set, or only current passengers, if 'all' is false


persons

IPerson[] persons()
An array of all people currently travelling (not yet successfully arrived)


vehicles

IVehicle[] vehicles()
An array of all vehicles currently travelling (not yet successfully arrived)


transports

ITransport[] transports()
An array of all transports currently travelling (not yet successfully arrived)


passengers

IPassenger[] passengers()
An array of all passengers currently travelling (not yet successfully arrived)


attached

IAttached[] attached()
An array of all attachments currently travelling


batchMode

boolean batchMode()
Returns true if the simulator is running in batch model


running

boolean running()
Returns true if the simulator is currently running (play button is pressed)


simulationComplete

boolean simulationComplete()
Returns true if the simulator has reached the end of the simulation term


simulationDay

DayOfWeek simulationDay()
Return the day of week of this simulation model run. This can be set and saved in the Timing window


simulationTime

double simulationTime()
The current simulation time, in seconds


startTime

double startTime()
A convenience method to return the start of the simulation term, in seconds. Equivalent to: model().parameters().simulationTerm().start().time()


totalAgents

int totalAgents()
Return the total number of people and vehicles currently in the model - those that have departed but not yet arrived.


totalPeople

int totalPeople()
Return the total number of people and vehicles currently in the model - those that have departed but not yet arrived.


totalVehicles

int totalVehicles()
Return the total number vehicles currently in the model - those moving between origin and destination, and those parked.


totalVehiclesParked

int totalVehiclesParked()
Return the total number of parked vehicles the model.


totalTransports

int totalTransports()
Return the total number of transports currently in the model - those that have departed but not yet arrived.


timeStep

void timeStep(double now,
              double interval)
Set the simulation time interval


running

void running(boolean isRunning)
Set the running state, equivalent to a press on the play/pause button


clearAgents

void clearAgents()
Destroy all people and vehicles


addPerson

void addPerson(IPerson a)
[INTERNAL]


addVehicle

void addVehicle(IVehicle a)
[INTERNAL]


addTransport

void addTransport(ITransport a)
[INTERNAL]


addPassenger

void addPassenger(IPassenger a)
[INTERNAL]


addAttached

void addAttached(IAttached a)
[INTERNAL]


finished

void finished(Object a)
[INTERNAL]


fixedTimeSignals

void fixedTimeSignals(boolean operating)
[INTERNAL]


simulationTime

void simulationTime(double t)
[INTERNAL] Set the current simulation time


addModelEventListener

void addModelEventListener(ModelEvent ev,
                           SimulationEventListener mel)
[INTERNAL] Call this to add a listener for model events. A plugin should call the "addModelEvent*Listener" method in BasePlugin, not this.


addAgentEventListener

void addAgentEventListener(AgentEvent ev,
                           SimulationEventListener ael)
[INTERNAL] Call this to add a listener for agent events. A plugin should call the "addAgentEvent*Listener" method in BasePlugin, not this.


removeSimulationEventListener

void removeSimulationEventListener(SimulationEventListener sel)
call this to remove a simulation event listener from list of agent and model event listeners


modelEvent

boolean modelEvent(ModelEvent event,
                   Object data)
[INTERNAL] Call a model-type event, with the given data


agentEvent

boolean agentEvent(IAgent agent,
                   AgentEvent event,
                   Object data)
[INTERNAL] Call an agent-type event, with the given agent and data


clearInternalListeners

void clearInternalListeners()
[INTERNAL]


addInternalListeners

void addInternalListeners()
[INTERNAL]


postOpen

void postOpen()
[INTERNAL]


postRenew

void postRenew()
[INTERNAL]


callPriority

void callPriority(Object event,
                  Object basePlugin,
                  CallOrder pri)
[INTERNAL]


pluginLoader

IPluginLoader pluginLoader()
[INTERNAL] A handle to the object that loads and unloads plugins


renew

void renew(String scenarioName)
[INTERNAL] Call before renewing model (re-open file)


internalEventListener

Object internalEventListener()