Class DynamicVisitor

All Implemented Interfaces:
Visitor, Agent, ModelEntity

public final class DynamicVisitor extends RoutingAgent<VisitorState,Visitor.Event> implements Visitor
Part of the dynamic elevator example
See Also:
  • Constructor Details

    • DynamicVisitor

      public DynamicVisitor()
  • Method Details

    • doEvent

      public Time doEvent(Time time)
      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)
      If implemented, the agent may also refer read-only to a bulletin board implementation of its parent domain or the root domain for additional external parameters.

      Do not invoke from outside the simulation loop!

      Specified by:
      doEvent in interface Agent
      Parameters:
      time - current simulation time
      Returns:
      tone - time of next event
    • sendRequest

      public void sendRequest(BasicAgent<?,?> dest, int destination, Time time)
      Specified by:
      sendRequest in interface Visitor
    • getName

      public String getName()
      Description copied from interface: ModelEntity
      Returns the name of this model entity

      Returns an empty string as default, may be overridden in derived classes.

      Specified by:
      getName in interface ModelEntity
      Overrides:
      getName in class BasicModelEntity
      Returns:
      the name of this model entity, may be an empty string but not null