Class EvadingAlgorithm
- java.lang.Object
-
- org.arakhne.afc.agentmotion.common.AbstractTargetPositionPredictionAlgorithm
-
- org.arakhne.afc.agentmotion.common.EvadingAlgorithm
-
- All Implemented Interfaces:
Serializable
,Cloneable
,EvadingMotionAlgorithm
public class EvadingAlgorithm extends AbstractTargetPositionPredictionAlgorithm implements EvadingMotionAlgorithm
Agent is changing its position for evading the target vector.This algorithm uses speeds or accelerations depending of the fleeing 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 FleeingMotionAlgorithm
fleeing
Fleeing algorithm to delegate to.-
Fields inherited from class org.arakhne.afc.agentmotion.common.AbstractTargetPositionPredictionAlgorithm
predictionDuration
-
-
Constructor Summary
Constructors Constructor Description EvadingAlgorithm(FleeingMotionAlgorithm fleeing, 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 evading the given target point.EvadingAlgorithm
clone()
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.EvadingMotionAlgorithm
predictTargetPosition
-
-
-
-
Field Detail
-
fleeing
protected final FleeingMotionAlgorithm fleeing
Fleeing algorithm to delegate to.
-
-
Constructor Detail
-
EvadingAlgorithm
public EvadingAlgorithm(FleeingMotionAlgorithm fleeing, double predictionDuration)
Constructor.- Parameters:
fleeing
- the fleeing 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 EvadingAlgorithm clone()
- Overrides:
clone
in classAbstractTargetPositionPredictionAlgorithm
-
calculate
public Vector2D<?,?> calculate(Point2D<?,?> position, double linearSpeed, double maxLinear, Point2D<?,?> targetPosition, Vector2D<?,?> targetLinearMotion)
Description copied from interface:EvadingMotionAlgorithm
Calculate the linear motion for evading the given target point.- Specified by:
calculate
in interfaceEvadingMotionAlgorithm
- 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.
-
-