de.steeringbehaviors.simulation.behaviors
Class Arrive

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

public class Arrive
extends Behavior
implements ObjectAttributes

Arrive - Behavior


Field Summary
protected  double m_activeDistance
          Maximum distance from the target to trigger the behaviour
protected  double m_steps
          Number of steps used to arrive at 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
Arrive()
          Constructor
Arrive(double x, double y, int steps, double influence)
          Constructor with static target specification
Arrive(Geometrie target, int steps, double influence)
          Constructor with moving target specification
 
Method Summary
 Vector2d calculate(Vehicle veh)
          Calculates the resulting force vector for this frame
 void setActiveDistance(double adistance)
          Sets the maximum distance from 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 name
 void setTarget(Geometrie target)
          Sets the moving target
 void setTargetXY(double x, double y)
          Sets the static target position
 
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_target

protected Geometrie m_target
Target object


m_activeDistance

protected double m_activeDistance
Maximum distance from the target to trigger the behaviour


m_steps

protected double m_steps
Number of steps used to arrive at the target

Constructor Detail

Arrive

public Arrive()
Constructor


Arrive

public Arrive(Geometrie target,
              int steps,
              double influence)
Constructor with moving target specification

Parameters:
target - Target geometry
steps - Number of steps used to reach the target
influence - Influence of the behaviour

Arrive

public Arrive(double x,
              double y,
              int steps,
              double influence)
Constructor with static target specification

Parameters:
x - X position
y - Y position
steps - Number of steps used to reach the target
influence - Influence of the behaviour
Method Detail

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value,
                         java.util.Hashtable objectList)
Sets a attribute specified by 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

setActiveDistance

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

Parameters:
adistance - Active distance

setTarget

public void setTarget(Geometrie target)
Sets the moving target

Parameters:
target - The target geometry

setTargetXY

public void setTargetXY(double x,
                        double y)
Sets the static target position

Parameters:
x - X position
y - Y position

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