Interface LongAgentGraphArc

All Superinterfaces:
AgentGraphArc, GeometricGraphArc
All Known Implementing Classes:
LongAgentGraphArcImpl, RailArc

public interface LongAgentGraphArc extends AgentGraphArc
Interface to be implemented by all classes that can be values of graph arcs of LongAgentsEnvironment.
Author:
Andrey Korotin
  • Method Details

    • addOccupyingAgent

      void addOccupyingAgent(LongAgent<? extends LongAgentGraphNode,? extends LongAgentGraphArc> longAgent)
      Adds the specified agent to collection of occupying agents (used to prevent the overlay of agents), e.g. when the agent enters this arc or jumps to it.
      Parameters:
      longAgent - agent being added
    • removeOccupyingAgent

      void removeOccupyingAgent(LongAgent<? extends LongAgentGraphNode,? extends LongAgentGraphArc> longAgent)
      Removes the specified agent from collection of occupying agents (used to prevent the overlay of agents), e.g. when the agent leaves this arc or is completely removed from graph environment.
      Parameters:
      longAgent - agent being removed
    • removeAllOccurrencesOccupyingAgent

      void removeAllOccurrencesOccupyingAgent(LongAgent<? extends LongAgentGraphNode,? extends LongAgentGraphArc> longAgent)
      Removes the all Occurrences of specified agent from collection of occupying agents (used to prevent the overlay of agents), e.g. when the agent leaves this arc or is completely removed from graph environment.
      Parameters:
      longAgent - agent being removed
    • getOccupyingAgents

      List<LongAgent<?,?>> getOccupyingAgents()
      Returns an unmodifiable list of occupying agents that are currently occupying this arc.
      Returns:
      unmodifiable list of occupying agents that are currently occupying this arc
    • getOccupyingAgents

      List<LongAgent<?,?>> getOccupyingAgents(boolean includingReverse)
      Returns an unmodifiable list of occupying agents that are currently occupying this arc or this arc and reverse.
      Parameters:
      includingReverse - should include agents on the reverse arch
      Returns:
      unmodifiable list of occupying agents that are currently occupying this arc
    • getReverseLongAgentArc

      LongAgentGraphArc getReverseLongAgentArc()
      Returns the arc that is a reverse to this one, or null if this is a one-way arc.
      Returns:
      reverse arc, or null