Interface AgentGraphNode

All Superinterfaces:
GeometricGraphNode
All Known Subinterfaces:
LongAgentGraphNode
All Known Implementing Classes:
AgentGraphNodeImpl, LongAgentGraphNodeImpl, RailNode

public interface AgentGraphNode extends GeometricGraphNode
Interface to be implemented by all classes that can be values of graph nodes of GraphEnvironment.
Author:
Andrey Malykhanov
  • Method Details

    • addAgent

      void addAgent(GraphAgent graphAgent)
      Adds the specified agent to this node, e.g. when the agent enters this node or jumps to it.
      Parameters:
      graphAgent - agent being added
    • removeAgent

      void removeAgent(GraphAgent graphAgent)
      Removes the specified agent from this node, e.g. when the agent leaves this node or is completely removed from graph environment.
      Parameters:
      graphAgent - agent being removed
    • getAgents

      List<GraphAgent> getAgents()
      Returns an unmodifiable list of agents that are currently at this node.
      Returns:
      unmodifiable list of agents that are currently at this node
    • containsAgent

      boolean containsAgent(GraphAgent graphAgent)
      Checks whether the specified agent is at this node.
      Parameters:
      graphAgent - specified agent
      Returns:
      true if this agent is at this node, false otherwise
    • addCallbackPosition

      void addCallbackPosition(GeometricGraphPosition position)
      Adds the specified callback position to this node. A onAgentReachedPosition(GraphAgent, GeometricGraphPosition) will be called every time an agent reaches this node.
      Parameters:
      position - specified callback position
      See Also:
    • removeCallbackPosition

      void removeCallbackPosition(GeometricGraphPosition position)
      Removes the specified callback position previously added by addCallbackPosition(GeometricGraphPosition) method, from this node. Does nothing if the specified callback position does not belong to this node.
      Parameters:
      position - callback position being removed
      See Also:
    • clearCallbackPositions

      void clearCallbackPositions()
      Removes all callback positions from this node.
      See Also:
    • getCallbackPositions

      List<GeometricGraphPosition> getCallbackPositions()
      Returns an unmodifiable list of all callback positions belonging to this node.
      Returns:
      unmodifiable list of all callback positions belonging to this node
    • afterAgentEntered

      void afterAgentEntered(GraphAgent graphAgent)
      Callback method called after an agent enters this node.
      Parameters:
      graphAgent - agent that have just entered this node
    • beforeAgentExited

      void beforeAgentExited(GraphAgent graphAgent)
      Callback method called before an agent exits this node.
      Parameters:
      graphAgent - agent that is about to exit this node
    • onAgentReachedPosition

      void onAgentReachedPosition(GraphAgent graphAgent, GeometricGraphPosition position)
      Callback method called when an agent reaches a callback position belonging to this node.
      Parameters:
      graphAgent - agent that have reached the specified callback position
      position - the position that have been reached