Class LongAgentGraphNodeImpl

java.lang.Object
com.amalgamasimulation.graphagent.AgentGraphNodeImpl
com.amalgamasimulation.graphagent.LongAgentGraphNodeImpl
All Implemented Interfaces:
AgentGraphNode, GeometricGraphNode, LongAgentGraphNode
Direct Known Subclasses:
RailNode

public class LongAgentGraphNodeImpl extends AgentGraphNodeImpl implements LongAgentGraphNode
Simple implementation of LongAgentGraphNode interface that is suitable in most simple cases. Contains the generic implementations of all methods of this interface.
Author:
Andrey Korotin
  • Constructor Details

    • LongAgentGraphNodeImpl

      public LongAgentGraphNodeImpl(Point point)
      Creates a new instance of LongAgentGraphNodeImpl with the specified Point.
      Parameters:
      point - specified point
  • Method Details

    • addOccupyingAgent

      public void addOccupyingAgent(LongAgent<?,?> longAgent)
      Description copied from interface: LongAgentGraphNode
      Adds the specified agent to collection of occupying agents (used to prevent the overlay of agents), e.g. when the agent enters this node or jumps to it.
      Specified by:
      addOccupyingAgent in interface LongAgentGraphNode
      Parameters:
      longAgent - agent being added
    • removeOccupyingAgent

      public void removeOccupyingAgent(LongAgent<?,?> longAgent)
      Description copied from interface: LongAgentGraphNode
      Removes the specified agent from collection of occupying agents (used to prevent the overlay of agents), e.g. when the agent leaves this node or is completely removed from graph environment.
      Specified by:
      removeOccupyingAgent in interface LongAgentGraphNode
      Parameters:
      longAgent - agent being removed
    • removeAllOccurrencesOccupyingAgent

      public void removeAllOccurrencesOccupyingAgent(LongAgent<?,?> longAgent)
      Description copied from interface: LongAgentGraphNode
      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 node or is completely removed from graph environment.
      Specified by:
      removeAllOccurrencesOccupyingAgent in interface LongAgentGraphNode
      Parameters:
      longAgent - agent being removed
    • getOccupyingAgents

      public List<LongAgent<?,?>> getOccupyingAgents()
      Description copied from interface: LongAgentGraphNode
      Returns an unmodifiable list of occupying agents that are currently occupying this node.
      Specified by:
      getOccupyingAgents in interface LongAgentGraphNode
      Returns:
      unmodifiable list of occupying agents that are currently occupying this node