Class StaticVisitor
java.lang.Object
org.simplesim.model.BasicModelEntity
org.simplesim.model.BasicAgent<VisitorState,Visitor.Event>
org.simplesim.examples.elevator.stat.StaticVisitor
- All Implemented Interfaces:
Visitor
,Agent
,ModelEntity
Part of the static elevator example
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.simplesim.model.Agent
Agent.UnknownEventType
Nested classes/interfaces inherited from interface org.simplesim.model.ModelEntity
ModelEntity.PortConnectionException, ModelEntity.PortOperationException, ModelEntity.UniqueConstraintViolationException
Nested classes/interfaces inherited from interface org.simplesim.examples.elevator.shared.Visitor
Visitor.Event
-
Field Summary
Fields inherited from interface org.simplesim.model.ModelEntity
ROOT_LEVEL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCalculates new outputs from the available inputs and implements the agent's strategy.getName()
Returns the name of this model entityvoid
sendRequest
(BasicAgent<?, ?> dest, int destination, Time time) Methods inherited from class org.simplesim.model.BasicAgent
getState, getTimeOfNextEvent, isSimulationRunning, pollModelChangeRequest, toggleSimulationIsRunning
Methods inherited from class org.simplesim.model.BasicModelEntity
addToDomain, equals, getAddress, getFullName, getInport, getLevel, getOutport, getParent, removeFromDomain, toString
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.simplesim.model.Agent
getState, getTimeOfNextEvent, log, log, log, log
Methods inherited from interface org.simplesim.model.ModelEntity
addToDomain, getAddress, getFullName, getInport, getLevel, getOutport, getParent, removeFromDomain
-
Constructor Details
-
StaticVisitor
public StaticVisitor()
-
-
Method Details
-
doEvent
Description copied from interface:Agent
Calculates new outputs from the available inputs and implements the agent's strategy.This method is called by the simulator every time this agent is scheduled as an event in the global event queue. Outputs are basically massages that have to be put onto the outport of this agent. It should implement the general strategy of the agent and will acquire the actual simulation time from the simulator.
This method is supposed to do the following steps:
- read the messages from the inports
- modify the agent's state
- compute output and write messages to other entities to the outports
- add events to the internal event queue if necessary
- return the time of the next local event (=next time to call this method)
Do not invoke from outside the simulation loop!
-
sendRequest
- Specified by:
sendRequest
in interfaceVisitor
-
getName
Description copied from interface:ModelEntity
Returns the name of this model entityReturns an empty string as default, may be overridden in derived classes.
- Specified by:
getName
in interfaceModelEntity
- Overrides:
getName
in classBasicModelEntity
- Returns:
- the name of this model entity, may be an empty string but not null
-