Class StaticElevator

All Implemented Interfaces:
Elevator, Agent, ModelEntity

public final class StaticElevator extends BasicAgent<ElevatorState,Elevator.Event> implements Elevator
Part of the static elevator example
See Also:
  • Constructor Details

    • StaticElevator

      public StaticElevator()
  • 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
    • processMessages

      public void processMessages()
      Specified by:
      processMessages in interface Elevator
    • sendMessage

      public void sendMessage(Agent recipient, Request content)
      Specified by:
      sendMessage in interface Elevator
    • enqueueEvent

      public void enqueueEvent(Elevator.Event event, Time time)
      Specified by:
      enqueueEvent in interface Elevator
    • 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