Class LongAgentTail<N extends LongAgentGraphNode,A extends LongAgentGraphArc>
java.lang.Object
com.amalgamasimulation.graphagent.GraphAgent<N,A>
com.amalgamasimulation.graphagent.LongAgentTail<N,A>
- Type Parameters:
N- type of values stored in graph nodesA- type of values stored in graph arcs
public class LongAgentTail<N extends LongAgentGraphNode,A extends LongAgentGraphArc>
extends GraphAgent<N,A>
Class representing a tail of a
LongAgent. This class is public only
for technical reasons, instances of this class should never be created
explicitly by users of this library.- Author:
- Andrey Malykhanov
-
Field Summary
FieldsFields inherited from class com.amalgamasimulation.graphagent.GraphAgent
basis, engine, lastTrajectoryNodeIndex, lastTrajectoryPointIndex -
Method Summary
Modifier and TypeMethodDescriptionvoidafterEnteredArc(Graph<N, A>.Arc arc) Callback method called immediately after entering an arc.voidbeforeExitedArc(Graph<N, A>.Arc arc) Callback method called before exiting entering an arc.voidbeforeExitedNode(Graph<N, A>.Node node) Callback method called before exiting a node.getAgent()Returns theLongAgentwhich this tail agent belongs to.getName()Returns the name of this agentprotected booleanisPossibleToStartMoving(double velocity) toString()Methods inherited from class com.amalgamasimulation.graphagent.GraphAgent
addCallbackPosition, afterEnteredNode, allowEnterArc, cancelMoving, cancelMovingInternal, checkEvents, clearCallbackPositions, disableCommandsExecution, enableCommandsExecution, engine, enterArcInternal, enterNodeInternal, enterSegment, eraseCurrentPathInternal, getCurrentAnimationArcAbsOffset, getCurrentAnimationHeading, getCurrentAnimationPoint, getCurrentAnimationTrajectoryAbsoluteOffset, getCurrentArc, getCurrentArcAbsOffset, getCurrentNode, getCurrentPoint, getCurrentPosition, getDistanceTraveled, getGraphEnvironment, getGraphPath, getHeading, getShortestPath, getShortestPath, getShortestPathToClosest, getTrajectory, getVelocity, hasGraphEnvironment, hasPath, isAtNode, isInGraph, isMoving, isOnArc, isOtherAgentInNodeHavingSameDirection, jumpTo, jumpTo, jumpTo, jumpTo, jumpToInternal, jumpToInternal, jumpToPathDestPosition, leaveCurrentArcInternal, leaveCurrentNodeInternal, moveAlongPath, moveTo, moveTo, moveTo, moveTo, moveToClosest, moveToClosestInternal, moveToIndicatorInternal, moveToInternal, onCallbackPositionReached, onDestinationReached, onOtherAgentReached, onPathNotFound, onSegmentExited, removeCallbackPosition, removeFromGraphEnvironment, removeFromGraphInternal, resetDistanceTraveled, setCurrentPathInternal, setGraphEnvironment, setVelocity, setVelocityInternal, startMovingAlongPath, time, tryExecuteCommand, tryUpdateDistanceTraveled, tryUpdatePositionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.amalgamasimulation.utils.time.Timeable
dateToTime, dateToTime, day, duration, hour, minute, second, timeToDate, week, wholeDays, wholeDays, wholeHours, wholeHours, wholeUnits
-
Field Details
-
agent
-
-
Method Details
-
getAgent
Returns theLongAgentwhich this tail agent belongs to.- Returns:
LongAgentwhich this tail agent belongs to
-
beforeExitedArc
Description copied from class:GraphAgentCallback method called before exiting entering an arc. To be overridden in subclasses. This agent is still on the specified arc when this method is calledEvent of exiting an arc can happen in 3 cases:
- in process of moving
- before jumping from current position on an arc
- before turning to opposite arc
- Overrides:
beforeExitedArcin classGraphAgent<N extends LongAgentGraphNode,A extends LongAgentGraphArc> - Parameters:
arc- arc being exited- See Also:
-
beforeExitedNode
Description copied from class:GraphAgentCallback method called before exiting a node. To be overridden in subclasses. This agent is still in the specified node when this method is called- Overrides:
beforeExitedNodein classGraphAgent<N extends LongAgentGraphNode,A extends LongAgentGraphArc> - Parameters:
node- node being exited- See Also:
-
afterEnteredArc
Description copied from class:GraphAgentCallback method called immediately after entering an arc. To be overridden in subclasses. This agent is already on the specified arc when this method is calledEvent of entering an arc can happen in 3 cases:
- in process of moving
- after jumping to a position on the specified arc
- after turning to opposite arc
- Overrides:
afterEnteredArcin classGraphAgent<N extends LongAgentGraphNode,A extends LongAgentGraphArc> - Parameters:
arc- arc being entered- See Also:
-
getName
Description copied from interface:AgentReturns the name of this agent- Specified by:
getNamein interfaceAgent- Overrides:
getNamein classGraphAgent<N extends LongAgentGraphNode,A extends LongAgentGraphArc> - Returns:
- name of this agent
-
isPossibleToStartMoving
protected boolean isPossibleToStartMoving(double velocity) - Overrides:
isPossibleToStartMovingin classGraphAgent<N extends LongAgentGraphNode,A extends LongAgentGraphArc>
-
toString
-