Encapsulates steering behaviours for moving entities.
@ivar self.entity:the owner of this instance
| Method Summary |
| |
__init__(self,
entity)
|
| boolean
|
accumulateForce(self,
runningTotal,
forceToAdd)
This function calculates how much of its max steering force the entity
has left to apply and then applies that amount of the force to add. |
| |
addTargetAgent(self,
targetAgent)
Adds new agent to list of target agents. |
| |
alignmentOff(self)
|
| |
alignmentOn(self)
Turns alignment behaviour on. |
| |
arrive(self,
targetPos,
deceleration)
Similar to seek but it attempts to arrive at the target position with
a zero velocity. |
| |
arriveOff(self)
|
| |
arriveOn(self)
Turns arrive behaviour on. |
| |
calculate(self)
Calculates and sums the steering forces from any active behaviors,
according to the method set in
SteeringBehaviours.summingMethod. |
| |
calculateDithered(self)
Sums up the active behaviors by assigning a probabilty of being
calculated to each behavior. |
| |
calculatePrioritized(self)
Calls each active steering behavior in order of priority and
acumulates their forces until the max steering force magnitude is
reached, at which time the function returns the steering force
accumulated to that point. |
| |
calculateWeightedSum(self)
Sums up all the active behaviors X their weights and truncates the
result to the max available steering force before returning. |
| |
cohesionOff(self)
|
| |
cohesionOn(self)
Turns cohesion behaviour on. |
| |
createFeelers(self)
Creates the antenna utilized by the wall avoidance behavior. |
| |
evadeOff(self)
|
| |
evadeOn(self,
targetAgent)
Turns evade behaviour on and defines agent to evade. |
| |
fleeOff(self)
|
| |
fleeOn(self)
Turns flee behaviour on. |
| |
flockingOff(self)
|
| |
flockingOn(self)
Turns flocking behaviour on. |
| |
followPath(self)
Given a series of svs_simulation.numdata.vectors.Vector2Ds,
this method produces a force that will move the agent along the waypoints
in order. |
| |
followPathOff(self)
|
| |
followPathOn(self)
Turns path following behaviour on. |
| |
forwardComponent(self)
Calculates the component of the steering force that is parallel with
the entity heading. |
| |
getHidingPosition(self,
posOb,
radiusOb,
posHunter)
Given the position of a hunter, and the position and radius of an
obstacle, this method calculates a position DistanceFromBoundary away
from its bounding radius and directly opposite the hunter. |
| |
hideOff(self)
|
| |
hideOn(self,
targetAgent)
Turns hide behaviour on and define sagent to hide from. |
| |
interposeOff(self)
|
| |
interposeOn(self,
targetAgent_1,
targetAgent_2)
Turns interpose behaviour on and defines two agents to interpose
between. |
| |
isAlignmentOn(self)
|
| |
isArriveOn(self)
|
| |
isCohesionOn(self)
|
| |
isEvadeOn(self)
|
| |
isFleeOn(self)
|
| |
isFollowPathOn(self)
|
| |
isHideOn(self)
|
| |
isInterposeOn(self)
|
| |
isObstacleAvoidanceOn(self)
|
| |
isOffsetPursuitOn(self)
|
| |
isPursuitOn(self)
|
| |
isSeekOn(self)
|
| |
isSeparationOn(self)
|
| |
isWallAvoidanceOn(self)
|
| |
isWanderOn(self)
|
| |
obstacleAvoidanceOff(self)
|
| |
obstacleAvoidanceOn(self)
Turns obstacle avoidance behaviour on. |
| |
offsetPursuitOff(self)
|
| |
offsetPursuitOn(self,
targetAgent,
offset)
Turns pursuit behaviour on, defines target of pursuit and set
offset. |
| |
pursuitOff(self)
|
| |
pursuitOn(self,
targetAgent)
Turns pursuit behaviour on and defines target of pursuit. |
| |
seek(self,
targetPos)
Given a target, this behavior returns a steering force which will
direct the agent towards the target. |
| |
seekOff(self)
|
| |
seekOn(self)
Turns seek behaviour on. |
| |
seekToPoint(self,
x,
y)
Sets a target point for entity to move towards and start seek
behaviour. |
| |
separationOff(self)
|
| |
separationOn(self)
Turns separation behaviour on. |
| |
setOffset(self,
offset)
Sets offset to steering behaviour. |
| |
setpath(self,
path)
Sets path for entity to follow. |
| |
setSummingMethod(self,
summingMethod)
Sets summing method, this should be a value defined in summing_method. |
| |
setTarget(self,
target)
Sets new target for steering behaviour. |
| |
sideComponent(self)
Calculates the component of the steering force that is perpendicuar
with the entity heading. |
| |
wallAvoidanceOff(self)
|
| |
wallAvoidanceOn(self)
Turns wall avoidance behaviour on. |
| |
wanderOff(self)
|
| |
wanderOn(self)
Turns wander behaviour on. |
| |
_behaviourOn(self,
behaviorType)
Tests if a specific bit of self.flags is set. |