Interface LongAgentGraphArc
- All Superinterfaces:
AgentGraphArc,GeometricGraphArc
- All Known Implementing Classes:
LongAgentGraphArcImpl,RailArc
Interface to be implemented by all classes that can be values of graph arcs
of
LongAgentsEnvironment.- Author:
- Andrey Korotin
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddOccupyingAgent(LongAgent<? extends LongAgentGraphNode, ? extends LongAgentGraphArc> 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 arc.getOccupyingAgents(boolean includingReverse) Returns an unmodifiable list of occupying agents that are currently occupying this arc or this arc and reverse.Returns the arc that is a reverse to this one, ornullif this is a one-way arc.voidremoveAllOccurrencesOccupyingAgent(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.voidremoveOccupyingAgent(LongAgent<? extends LongAgentGraphNode, ? extends LongAgentGraphArc> longAgent) Removes the specified agent from collection of occupying agents (used to prevent the overlay of agents), e.g.Methods inherited from interface com.amalgamasimulation.graphagent.AgentGraphArc
addAgent, addCallbackPosition, afterAgentEntered, beforeAgentExited, clearCallbackPositions, containsAgent, getAgents, getCallbackPositions, getReverseArc, onAgentReachedPosition, onAgentVelocityChanged, recalculateAgents, removeAgent, removeCallbackPositionMethods inherited from interface com.amalgamasimulation.graphagent.GeometricGraphArc
getLength, getPolyline, getReverseOffset, setReverseArc
-
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
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
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, ornullif this is a one-way arc.- Returns:
- reverse arc, or
null
-