public interface Controller extends Runnable
Modifier and Type | Interface and Description |
---|---|
static class |
Controller.State
The current state of the controller.
|
static class |
Controller.StopOccasion
The reason for the end of controller execution.
|
Modifier and Type | Method and Description |
---|---|
void |
addAgent(Agent agent,
Timestamp startTime)
Adds an agent to this controller to be executed as a process starting at
the given timestamp.
|
void |
addEvent(Event event)
Adds an event to be handled by this controller.
|
void |
addStateListener(ControllerStateListener listener)
Adds a listener that is informed of the state of the controller changes.
|
Timestamp |
currentTime()
Returns the current controller time (e.g., simulation time or wall-clock time).
|
RuntimePolicy |
getRuntimePolicy()
Returns this controller's runtime policy.
|
Controller.State |
getState()
Returns the current state of the controller.
|
Controller.StopOccasion |
getStopOccasion()
Returns the stop state and reason of this controller.
|
int |
handledProcesses()
Returns the amount of processes/agents currently handled by this controller.
|
void |
run()
Runs this controller by advancing platform time and scheduling added
processes/agents based on their requests.
|
void |
stop()
Causes this controller to stop execution of added processes.
|
void addAgent(Agent agent, Timestamp startTime)
agent
- Agent to be added and executed.startTime
- Timestamp of first scheduling for execution.int handledProcesses()
void addEvent(Event event)
event
- The event to be handledTimestamp currentTime()
fully time-synchronized simulation
and operation mode
the controller time holds for all contained processes.
If controller time management allows for time divergence between processes (e.g., in
optimistic simulation), the least current time of all processes is returned.RuntimePolicy getRuntimePolicy()
void stop()
Controller.StopOccasion getStopOccasion()
Controller.StopOccasion.NONE
if the controller was not stopped.void run()
Runs this controller by advancing platform time and scheduling added processes/agents based on their requests.
Depending on RuntimePolicy
, the method will finish and return
as soon as, e.g., no further process is present. On end of execution the controller
calls stop()
. No further actions (e.g., agent addition) can be performed
afterwards.
Controller.State getState()
void addStateListener(ControllerStateListener listener)
listener
- The listener to be addedCopyright © Aimpulse Intelligent Systems GmbH
All rights reserved.