de.steeringbehaviors.simulation.behaviors
Class Pursuit

java.lang.Object
  extended by de.steeringbehaviors.simulation.behaviors.Behavior
      extended by de.steeringbehaviors.simulation.behaviors.Pursuit
All Implemented Interfaces:
ObjectAttributes

public class Pursuit
extends Behavior

Pursuit Pursuits a specified target object. This is not the same as the seek behavior! In Seek the current position of the target is the destination point. The pursuit behavior tries to anticipate the movement of the target and uses the estimated future position of the target as destination.


Field Summary
protected  double m_activeDistance
          Maximum distance to trigger the behaviour
protected  double m_estimateFactor
          The estimate factor is used to determine the future position of the quarry.
protected  Point2d m_estimatePos
          This is the estimated position of the target object
protected  Point2d m_prevPos
          The previous position of the target
protected  Geometrie m_target
          Target object
 
Fields inherited from class de.steeringbehaviors.simulation.behaviors.Behavior
m_behaviorName, m_influence, m_needsNeighborhood, m_neighborhood
 
Constructor Summary
Pursuit()
          Constructor
Pursuit(Geometrie target, double influence)
          Constructor
 
Method Summary
 Vector2d calculate(Vehicle veh)
          Calculates the resulting force vector for this frame
 void setActiveDistance(double adistance)
          Sets the maximum distance to the target to trigger the behaviour
 void setAttribute(java.lang.String name, java.lang.String value, java.util.Hashtable objectList)
          Sets a attribute specified by the name
 void setTarget(Geometrie target)
          Sets the current target
 
Methods inherited from class de.steeringbehaviors.simulation.behaviors.Behavior
getBehaviorName, getInfluence, needsNeighborhood, setInfluence, setNeighborhood, setSpecialObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_estimateFactor

protected double m_estimateFactor
The estimate factor is used to determine the future position of the quarry. A factor of zero makes the pursuit behavior work the same way as the seek behavior.


m_estimatePos

protected Point2d m_estimatePos
This is the estimated position of the target object


m_prevPos

protected Point2d m_prevPos
The previous position of the target


m_target

protected Geometrie m_target
Target object


m_activeDistance

protected double m_activeDistance
Maximum distance to trigger the behaviour

Constructor Detail

Pursuit

public Pursuit()
Constructor


Pursuit

public Pursuit(Geometrie target,
               double influence)
Constructor

Parameters:
target - Target object
influence - Influence of the behaviour
Method Detail

setActiveDistance

public void setActiveDistance(double adistance)
Sets the maximum distance to the target to trigger the behaviour

Parameters:
adistance - The active distance

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value,
                         java.util.Hashtable objectList)
Sets a attribute specified by the name

Specified by:
setAttribute in interface ObjectAttributes
Overrides:
setAttribute in class Behavior
Parameters:
name - name of the attribute
value - value of the attribute
objectList - hashtable of all steeringobjects

setTarget

public void setTarget(Geometrie target)
Sets the current target

Parameters:
target - The new target

calculate

public Vector2d calculate(Vehicle veh)
Calculates the resulting force vector for this frame

Overrides:
calculate in class Behavior
Parameters:
veh - The vehicle
Returns:
Returns the resulting force