Class FleeingAlgorithm
- java.lang.Object
-
- org.arakhne.afc.agentmotion.common.FleeingAlgorithm
-
- All Implemented Interfaces:
Serializable
,Cloneable
,FleeingMotionAlgorithm
public class FleeingAlgorithm extends Object implements FleeingMotionAlgorithm, Serializable, Cloneable
Agent is changing its position for fleeing the target point.This algorithm uses speeds or accelerations depending on the value of
maxLinear
.- 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
-
-
Constructor Summary
Constructors Constructor Description FleeingAlgorithm()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Vector2D<?,?>
calculate(Point2D<?,?> position, double linearSpeed, double maxLinear, Point2D<?,?> target)
Calculate the linear motion for fleeing the target position.FleeingAlgorithm
clone()
Clone this algorithm.
-
-
-
Method Detail
-
clone
@Pure public FleeingAlgorithm clone()
Description copied from interface:FleeingMotionAlgorithm
Clone this algorithm.- Specified by:
clone
in interfaceFleeingMotionAlgorithm
- Overrides:
clone
in classObject
- Returns:
- the clone.
-
calculate
public Vector2D<?,?> calculate(Point2D<?,?> position, double linearSpeed, double maxLinear, Point2D<?,?> target)
Description copied from interface:FleeingMotionAlgorithm
Calculate the linear motion for fleeing the target position.- Specified by:
calculate
in interfaceFleeingMotionAlgorithm
- 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.target
- is the point to flee.- Returns:
- the agent motion.
-
-