Class LongAgentGraphNodeImpl
java.lang.Object
com.amalgamasimulation.graphagent.AgentGraphNodeImpl
com.amalgamasimulation.graphagent.LongAgentGraphNodeImpl
- All Implemented Interfaces:
AgentGraphNode,GeometricGraphNode,LongAgentGraphNode
- Direct Known Subclasses:
RailNode
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 Summary
ConstructorsConstructorDescriptionLongAgentGraphNodeImpl(Point point) Creates a new instance ofLongAgentGraphNodeImplwith the specifiedPoint. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOccupyingAgent(LongAgent<?, ?> longAgent) Adds the specified agent to collection of occupying agents (used to prevent the overlay of agents), e.g.Returns an unmodifiable list of occupying agents that are currently occupying this node.voidremoveAllOccurrencesOccupyingAgent(LongAgent<?, ?> longAgent) Removes the all Occurrences of specified agent from collection of occupying agents (used to prevent the overlay of agents), e.g.voidremoveOccupyingAgent(LongAgent<?, ?> longAgent) Removes the specified agent from collection of occupying agents (used to prevent the overlay of agents), e.g.Methods inherited from class com.amalgamasimulation.graphagent.AgentGraphNodeImpl
addAgent, addCallbackPosition, afterAgentEntered, beforeAgentExited, clearCallbackPositions, containsAgent, getAgents, getCallbackPositions, getPoint, onAgentReachedPosition, removeAgent, removeCallbackPosition, setPoint, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.amalgamasimulation.graphagent.AgentGraphNode
addAgent, addCallbackPosition, afterAgentEntered, beforeAgentExited, clearCallbackPositions, containsAgent, getAgents, getCallbackPositions, onAgentReachedPosition, removeAgent, removeCallbackPositionMethods inherited from interface com.amalgamasimulation.graphagent.GeometricGraphNode
getPoint
-
Constructor Details
-
LongAgentGraphNodeImpl
Creates a new instance ofLongAgentGraphNodeImplwith the specifiedPoint.- Parameters:
point- specified point
-
-
Method Details
-
addOccupyingAgent
Description copied from interface:LongAgentGraphNodeAdds 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:
addOccupyingAgentin interfaceLongAgentGraphNode- Parameters:
longAgent- agent being added
-
removeOccupyingAgent
Description copied from interface:LongAgentGraphNodeRemoves 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:
removeOccupyingAgentin interfaceLongAgentGraphNode- Parameters:
longAgent- agent being removed
-
removeAllOccurrencesOccupyingAgent
Description copied from interface:LongAgentGraphNodeRemoves 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:
removeAllOccurrencesOccupyingAgentin interfaceLongAgentGraphNode- Parameters:
longAgent- agent being removed
-
getOccupyingAgents
Description copied from interface:LongAgentGraphNodeReturns an unmodifiable list of occupying agents that are currently occupying this node.- Specified by:
getOccupyingAgentsin interfaceLongAgentGraphNode- Returns:
- unmodifiable list of occupying agents that are currently occupying this node
-