Class PursuingAlgorithm
- java.lang.Object
-
- org.arakhne.afc.agentmotion.common.AbstractTargetPositionPredictionAlgorithm
-
- org.arakhne.afc.agentmotion.common.PursuingAlgorithm
-
- All Implemented Interfaces:
Serializable
,Cloneable
,PursuingMotionAlgorithm
public class PursuingAlgorithm extends AbstractTargetPositionPredictionAlgorithm implements PursuingMotionAlgorithm
Agent is changing its position for pursuing the target point.This algorithm uses speeds or accelerations depending of the seeking algorithm to delegate to.
- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:51
- Author:
- Stéphane GALLAND
- See Also:
- Serialized Form
- Maven Group Id:
- org.arakhne.afc.advanced
- Maven Artifact Id:
- agentmotion
-
-
Field Summary
Fields Modifier and Type Field Description protected SeekingMotionAlgorithm
seeking
Seeking algorithm to delegate to.-
Fields inherited from class org.arakhne.afc.agentmotion.common.AbstractTargetPositionPredictionAlgorithm
predictionDuration
-
-
Constructor Summary
Constructors Constructor Description PursuingAlgorithm(SeekingMotionAlgorithm seeking, double predictionDuration)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vector2D<?,?>
calculate(Point2D<?,?> position, double linearSpeed, double maxLinear, Point2D<?,?> targetPosition, Vector2D<?,?> targetLinearMotion)
Calculate the linear motion for pursuing the target point.PursuingAlgorithm
clone()
Clone this algorithm.boolean
equals(Object obj)
int
hashCode()
-
Methods inherited from class org.arakhne.afc.agentmotion.common.AbstractTargetPositionPredictionAlgorithm
predictTargetPosition
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.arakhne.afc.agentmotion.PursuingMotionAlgorithm
predictTargetPosition
-
-
-
-
Field Detail
-
seeking
protected final SeekingMotionAlgorithm seeking
Seeking algorithm to delegate to.
-
-
Constructor Detail
-
PursuingAlgorithm
public PursuingAlgorithm(SeekingMotionAlgorithm seeking, double predictionDuration)
Constructor.- Parameters:
seeking
- the seeking algorithm to delegate to.predictionDuration
- the duration of prediction.
-
-
Method Detail
-
equals
@Pure public boolean equals(Object obj)
- Overrides:
equals
in classAbstractTargetPositionPredictionAlgorithm
-
hashCode
@Pure public int hashCode()
- Overrides:
hashCode
in classAbstractTargetPositionPredictionAlgorithm
-
clone
@Pure public PursuingAlgorithm clone()
Description copied from interface:PursuingMotionAlgorithm
Clone this algorithm.- Specified by:
clone
in interfacePursuingMotionAlgorithm
- Overrides:
clone
in classAbstractTargetPositionPredictionAlgorithm
- Returns:
- the clone.
-
calculate
public Vector2D<?,?> calculate(Point2D<?,?> position, double linearSpeed, double maxLinear, Point2D<?,?> targetPosition, Vector2D<?,?> targetLinearMotion)
Description copied from interface:PursuingMotionAlgorithm
Calculate the linear motion for pursuing the target point.- Specified by:
calculate
in interfacePursuingMotionAlgorithm
- Parameters:
position
- is the current position of the entity.linearSpeed
- is the current linear speed of the entity.maxLinear
- is the maximal linear speed or acceleration of the entity.targetPosition
- is the position of the target.targetLinearMotion
- is the linear motion of the target.- Returns:
- the agent motion.
-
-