Class ArrivingSteeringAlgorithm
- java.lang.Object
-
- org.arakhne.afc.agentmotion.steering.ArrivingSteeringAlgorithm
-
- All Implemented Interfaces:
Serializable
,Cloneable
,ArrivingMotionAlgorithm
public class ArrivingSteeringAlgorithm extends Object implements ArrivingMotionAlgorithm, Serializable, Cloneable
Agent is changing its position for arriving (stopping) the target point.This algorithm uses accelerations.
- 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 int
approximationFactor
Approximation factor.protected double
decelerationDistance
Square distance to the target under which the agent could decelerate.protected double
stopDistance
Square distance to the target under which the agent could stop.
-
Constructor Summary
Constructors Constructor Description ArrivingSteeringAlgorithm(double stopDistance, double decelerationDistance, int approximationFactor)
Constructor.
-
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 arriving the target point.ArrivingSteeringAlgorithm
clone()
Clone this algorithm.
-
-
-
Field Detail
-
stopDistance
protected final double stopDistance
Square distance to the target under which the agent could stop.
-
decelerationDistance
protected final double decelerationDistance
Square distance to the target under which the agent could decelerate.
-
approximationFactor
protected final int approximationFactor
Approximation factor.
-
-
Constructor Detail
-
ArrivingSteeringAlgorithm
public ArrivingSteeringAlgorithm(double stopDistance, double decelerationDistance, int approximationFactor)
Constructor.- Parameters:
stopDistance
- the distance to the target under which the agent could stop.decelerationDistance
- the distance the target under which the agent could decelerate.approximationFactor
- the factor used for approximate the deceleration. It must be greater than 1.
-
-
Method Detail
-
clone
@Pure public ArrivingSteeringAlgorithm clone()
Description copied from interface:ArrivingMotionAlgorithm
Clone this algorithm.- Specified by:
clone
in interfaceArrivingMotionAlgorithm
- Overrides:
clone
in classObject
- Returns:
- the clone.
-
calculate
public Vector2D<?,?> calculate(Point2D<?,?> position, double linearSpeed, double maxLinear, Point2D<?,?> target)
Description copied from interface:ArrivingMotionAlgorithm
Calculate the linear motion for arriving the target point.- Specified by:
calculate
in interfaceArrivingMotionAlgorithm
- 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 reach.- Returns:
- the agent motion.
-
-