Package populus :: Module SocialPuppet :: Class Avatar
[frames] | no frames]

Class Avatar


This is the character that represents the user in the environment.

Instance Methods
 
__init__(self, game, name='Player', parent=render, pos2D=(0, 0), profile=AgentProfile(AgentProfile.manProfile), preferences=AgentPreferences(AgentPreferences.noPreferences))
Setup Avatar.
 
__str__(self)
Print out something useful about the fsm
 
isPerson(self)
 
isRemoved(self)
Check if the current instance is been removed.
 
position(self)
 
heading(self)
 
speed(self)
 
setSpeed(self, s)
 
velocity(self)
 
setVelocity(self, v)
 
setProfile(self, profile)
 
setPreferences(self, preferences)
 
forward(self)
 
setForward(self, v)
 
mass(self)
 
setMass(self, m)
 
maxSpeed(self)
 
setMaxSpeed(self, ms)
 
maxForce(self)
 
setMaxForce(self, mf)
 
turning(self)
 
setTurning(self, alpha)
 
maxAngSpeed(self)
 
setMaxAngSpeed(self, max)
 
headPosition(self)
 
headHeading(self)
 
height(self)
 
setHeight(self, h)
 
radius(self)
 
setRadius(self, r)
 
headRadius(self)
 
setHeadRadius(self, r)
 
maxHeadAngSpeed(self)
 
setMaxHeadAngSpeed(self, max)
 
maxHeadAngExt(self)
 
setMaxHeadAngExt(self, max)
 
maxEyesAngExt(self)
 
setMaxEyesAngExt(self, max)
 
headTurning(self)
 
setHeadTurning(self, alpha)
 
headForward(self)
 
setHeadForward(self, v)
 
eyesForward(self)
 
eyesPosition(self)
 
getPos(self)
 
getNodePath(self)
 
getColor(self)
 
getPhysActor(self)
 
getPhysShape(self)
 
getHeadNodePath(self)
 
getEyesNodePath(self)
 
getFeetNodePath(self)
 
getName(self)
 
getKey(self)
 
getHpr(self)
 
getState(self)
 
getIsPlayer(self)
 
getShowStats(self)
 
getLookingAt(self)
 
getActorBottom(self)
 
getDisplayName(self)
 
getLocalVector(self, v)
 
getLocalPoint(self, p)
 
getGlobalVector(self, v)
 
getGlobalPoint(self, p)
 
setPos(self, p)
 
setH(self, heading)
 
setConversation(self, conv)
 
setIsPlayer(self, state)
 
setShowStats(self, state)
 
setDisplayName(self, displayName)
 
setColor(self, color)
Set the Avatar color.
 
setMaterialAmbient(self, ambient, materialName='Material.008')
 
showVision(self)
 
showProxemics(self)
 
isStanding(self)
 
isRunning(self)
 
isAttentive(self)
 
isConversating(self)
 
isLookingAt(self)
 
isFocused(self)
 
isGlancingAt(self)
 
isCallingAttention(self)
 
isMoving(self)
 
hasMutualAttention(self)
 
hasMutualGaze(self)
 
isFacing(self, otherNodePath)
 
hasUtteranceSystem(self)
 
isWelcomIntoConversation(self)
 
setTTMind(self, new_mind)
 
getConversationPrivacy(self)
 
setConversationPrivacy(self, prv)
 
getPersonalDistance(self)
 
setPersonalDistance(self, dist)
 
getPersonalDistanceWeight(self)
 
setPersonalDistanceWeight(self, w)
 
getEqualityWeight(self)
 
setEqualityWeight(self, w)
 
getCohesionWeight(self)
 
setCohesionWeight(self, w)
 
getTestWeight(self)
 
getProfile(self)
 
getPreferences(self)
 
setTestWeight(self, w)
 
getTest2Weight(self)
 
setTest2Weight(self, w)
 
getObstacleAvoidanceSafeRadius(self)
 
setObstacleAvoidanceSafeRadius(self, r)
 
updateWhenRemote(self, dt)
Main updater for remotely controlled avatar.
 
update(self, dt)
 
updateFiniteStateMachine(self, dt)
Behavioral high level rules modeled as a state machine.
 
updateRedList(self, dt)
 
updateShortTermMemory(self, dt)
 
updatePosition(self, dt)
 
updateOrientation(self, dt)
 
updateHeadOrientation(self, dt)
 
updateEyesOrientation(self, dt)
Very first attempt of implementing eyes rotation and pointing system.
 
updateVelocity(self, dt)
Update velocity vector accordingly with the new desired velocity, that is a new motivation in moving toward a certain direction.
 
updateTurning(self, dt)
 
updateHeadTurning(self, dt)
 
updateSteeringBehaviors(self, dt)
 
updateTurntakingMind(self, dt)
update Turntaking mind (tick method inside YTTM.Mind)
 
animateWithDesiredVelocity(self)
Control animation updating using a motivation.
 
setDestination(self, point)
The user wants to go to a given destination point.
 
setInteraction(self, other)
The user wants to interact with other individuals or objects.
 
setText(self, sentence)
The user typed some text.
 
spanDirections(self, spanning)
This function return a subset of isb directions indexes spanned by a fan centered along the forward axis with angular extension spannig.
 
initSetOfCosts(self, c=0.0, m=1.0)
Create and initialize a set of costs for later user.
 
addCost(self, set, cost, magnitude=1.0)
Add a new entry with cost and magnitude to the given set of costs.
 
setCost(self, set, index, cost)
 
setMagnitude(self, set, index, magnitude)
 
getCost(self, set, index)
 
getMagnitude(self, set, index)
 
createSteeringBehavior(self, behaviorName, behaviorTask, priority=1, weight=1.0, tStep=0.0, profile={})
Create a new steering behavior to be activated when needed.
 
startSteeringBehavior(self, type, delay=0.0, timer=0.0, start=0.0, end=0.0, uponStop=None, restart=False, name=None, **vars)
Run an instance of behavior.
 
requestStartBehavior(self, caller, type, **vars)
Request to run a behavior from an external caller module.
 
requestStopBehavior(self, caller, type)
Request to stop a behavior from an external caller.
 
requestStopAllBehaviors(self, caller)
Stop all the behaviors requested by an external caller.
 
getBehaviorPriority(self, bhvKey)
 
getBehaviorWeight(self, bhvKey)
 
getBehaviorTime(self, bhvKey)
 
getBehaviorTimeMarker(self, bhvKey, marker)
 
modifyBehaviorPriority(self, bhvKey, newPriority)
 
modifyBehaviorWeight(self, bhvKey, newWeight)
 
setBehaviorTimer(self, bhvKey, time)
 
setBehaviorTimeMarker(self, bhvKey, marker)
 
stopSteeringBehavior(self, bhvId)
Stop execution of a behavior's instance.
 
stopBehaviorLater(self, bhvKey, time)
Stop a behavior's instance after a given time.
 
investigateBehavior(self, type=None)
 
convertForceIntoCosts(self, force)
This function is meant for converting the most common result of a steering function into the correspondent result of an inverse steering function.
 
cleanMotivationBuffers(self, bhvKey)
 
heuristicallyCombineHighestPriority(self, tableOfCosts)
 
linearlyCombineHighestPriority(self, forces)
Linearly combine forces produced by the highest priority behaviors.
 
chooseHighestPriority(self, forces)
Return the force produced by the highest priority behavior.
 
addDesiredVelocity(self, bhvKey, velocity)
 
addDesiredDirection(self, bhvKey, direction)
 
addDesiredHeadDirection(self, bhvKey, direction)
 
addDesiredEyesDirection(self, bhvKey, direction)
 
evaluateDesiredVelocity(self, dt)
 
evaluateDesiredDirection(self, dt)
 
evaluateDesiredHeadDirection(self, dt)
 
evaluateDesiredEyesDirection(self, dt)
 
updateBehavior(self, bhvKey, dt)
 
steerForSeek(self, target)
This steering function compute a desired velocity toward a given target.
 
steerForFlee(self, target)
This steering function compute a desired velocity away from a given target.
 
steerForArrival(self, target, slowing_distance)
This steering function compute a desired velocity toward the target.
 
steerForMinDistance(self, neighborhood, numNeighbors, maxDistance)
This steering function compute a repulsion force away from a group of given neighbors.
 
steerForKeepGroupSpace(self, neighborhood, numNeighbors, minDistance, maxDistance)
This steering function compute a group space force that motivates an agent in keeping a mean equal distance from the neighborhood central point.
 
steerForCohesion(self, neighborhood, numNeighbors, point=None, distance_offset=0)
This steering function compute a cohesion force that motivate and agent in moving toward its neighborhood to avoid being isolated.
 
steerForAvoidObstacle(self, obstaclePos, obstacleRadius, minTimeToCollision=5.0, radius=None)
This steering function compute a desired direction to motivate an agent in avoiding a potential collision with an obstacle.
 
steerForAvoidObstacles(self, obstacleGroup, numObstacles, minTimeToCollision=5.0, radius=None)
This steering function compute a desired direction to motivate an agent in avoiding a potential collision with a group of obstacles.
 
steerForAvoidObstaclesNEW(self, obstacleGroup, numObstacles, minTimeToCollision=5.0, radius=None, spanning=210.0)
Steer for Avoid Obstacles with Inverse Steering Behaviors.
 
steerForFacing(self, neighborhood, numNeighbors)
This steering function compute a desired direction to rotate an agent in order to make it face the neighborhood.
 
ContainmentAreaBehavior(self, bhv, area)
Stay within a given Area containing a polygonal boundary representation.
 
ContainmentBehavior(self, bhv, minx, maxx, miny, maxy)
Rectangular containment, NOT USED
 
fakeConversation(self, task)
Utter 'blah' continuously, just for debugging.
 
FindChairBehavior(self, bhv)
Experiments
 
WatchingBehavior(self, bhv, target, minRadius, facing, speed)
 
QueueAccompanyingBehavior(self, bhv, queueTarget, primaryQueuer, closeness)
NOT USED, using QueuingGroup instead.
 
QueueDefendingBehavior(self, bhv, target, offsetStart, offset, speed, engine, currentSpot)
 
ConverseWithinQueuingGroupBehavior(self, bhv, group)
NOT USED
 
setQueuingDistance(self, d)
A value determining how much distance the avatar finds 'comfortable' to keep in a queue.
 
getQueuingDistance(self)
 
MoveToQueueBehavior(self, bhv, queue)
Move towards the queue center.
 
StayInQueueBehavior(self, bhv, queue)
If the avatar is in the queue and not first in line, it takes a spot behind the avatar right before it (according to the queue's participants list), with an offset depending on the personal queuingDistance and the general queuing direction.
 
MoveToAreaBehavior(self, bhv, area, nextAction, nextActionArgs, brBhv)
Given a certain Area, the avatar picks a random spot inside that area (only once) and moves towards that.
 
MoveToQueueTargetBehavior(self, bhv, queue)
NOT USED
 
QueuingBehavior(self, bhv, target, offsetStart, offset, speed, engine)
NOT USED
 
conversationRearrange(self, task)
 
GoToBehavior(self, bhv, dest, speed)
A basic and simple behavior to command the agent to go to a given destination point.
 
LocomotionBehavior(self, bhv, target, slowing_distance, approach_distance, speed, obAvoid)
This behavior moves the agent toward a target point, which could be static or dynamic (eg.
 
PathFollow(self, bhv, target, slowing_distance, approach_distance, speed, obAvoid)
 
AvoidObstaclesBehavior(self, bhv)
This behavior let an agent avoid obstacles in the environment.
 
BrakingBehavior(self, bhv)
This behavior let the agent slow down when his walking and there are people in front of him.
 
TurningBehavior(self, bhv, target)
This behavior turn the agent toward a given target (usually another avatar) facing it with whole body at the end.
 
HeadTurningBehavior(self, bhv, target)
This behavior turn the agent's head toward a given target (usually another agent).
 
LookAtBehavior(self, bhv, target, duration, lazy)
This behavior task let the agent look at a given target.
 
KeepIntimateDistanceBehavior(self, bhv)
Keep others out from your intimate space by stepping away from them.
 
KeepPersonalDistanceBehavior(self, bhv)
This behavior will induce an agent in keeping a personal distance from its neighbors.
 
KeepConversationalEqualityBehavior(self, bhv)
This behavior will induce an agent in keeping social equality in an ongoing conversation.
 
KeepConversationalCohesionBehavior(self, bhv)
This behavior induce an agent in moving toward a conversation to avoid being isolated and considered outside the ongoing social interaction.
 
TestConversationalBehavior(self, bhv)
 
Test2ConversationalBehavior(self, bhv)
 
KeepConversationalCommonAttentionBehavior(self, bhv)
This behavior induce and agent in having the same attention behavior of the other participants in the conversation.
 
KeepConversationalSpeakerAttention(self, bhv)
 
PasserbyRegionAvoidanceBehavior(self, bhv, conversation)
This behavior let a passerby agent who is walking close to a conversation avoid to step into the region.
 
AvoidRegionBehavior(self, bhv, territory)
This is a new and more general version of passerby region avoidance.
 
TerritorialFocusBehavior(self, bhv, territory)
Keep territorial focus.
 
GazeRegionBehavior(self, bhv, territory)
Gaze at members out in the region.
 
GazeNucleusBehavior(self, bhv, territory)
Gaze at members part of the nucleus.
 
GlancePassersbyBehavior(self, bhv, territory)
Glance at people passing by.
 
KeepBaseOrientationBehavior(self, bhv, direction)
Keep a base very low priority orientation.
 
AlignConversationWithQueueBehavior(self, bhv, queueTarget, currentSpot)
 
KeepConversationalDomainAwarenessBehavior(self, bhv)
This behavior let an agent engaged in a conversation aware of the conversation domain, that is aware of who or what is moving close enough to the conversation and of the other participants themselves.
 
IdleGazeBehavior(self, bhv)
This behavior generates autonomous idle gazes during the avatar's locomotion or standing
 
ResponseBehavior(self, bhv)
A simple behavior making the agents respond to each other according to their standings towards each other
 
TestBehavior(self, bhv)
A steering behavior for testing.
 
memorize(self, entry, time=5.0)
 
forget(self, entry)
 
remember(self, entry)
 
focusOn(self, target=None, priority=None, caller=None)
Focus on target higher level behavior interface.
 
glanceAt(self, target=None, duration=2.0, priority=None, caller=None, name=None)
Glance at target higher level behavior interface.
 
setPropAsTarget(self, prop, engine)
 
gazeAt(self, target=None, duration=0.0, priority=None, caller=None, name=None)
Gaze at target higher level behavior interface.
 
faceTo(self, dir, duration=0.0, priority=None, caller=None)
NOTE: this behavior to keep compativility with the code in YTTMPopulus.py
 
goTo(self, dest)
Move the agent to a given destination point.
 
moveTo(self, target)
Move to destination higher level behavior interface.
 
turnToward(self, target)
Turn body higher level behavior interface.
 
turnHeadToward(self, target)
Turn head higher level behavior interface.
 
doIdleGaze(self, stop=False)
 
wantTurn(self)
 
purchaseAtCounter(self, counter)
 
purchaseAtCounterWith(self, counter, companyList)
 
to_str(self)
 
joinQueue(self, qqueue)
Start MoveToQueue behavior.
 
leaveQueue(self, queue)
Go to some spot away from the queue, fixed for now.
 
say(self, text, stop=None)
Say something to the target.
 
addressedBy(self, other, text)
 
checkForReply(self, task)
 
closeUtteranceSystem(self)
 
initiateConversation(self, guest)
 
inviteToConversation(self, conversation)
Invite an avatar to join the given conversation.
 
joinConversation(self, conversation)
 
disjoinConversation(self)
 
enterRun(self)
 
enterStand(self)
 
enterAttentive(self)
 
exitRun(self)
 
enterConversation(self)
 
exitConversation(self)
 
getEditableProperties(self)
 
setEditableProperties(self, properties)
 
testScript(self)

Inherited from direct.fsm.FSM.FSM: __repr__, cleanup, defaultEnter, defaultExit, defaultFilter, demand, filterOff, forceTransition, getCurrentOrNextState, getStateChangeEvent, isInTransition, request, requestNext, requestPrev, setBroadcastStateChanges, setStateArray

Inherited from direct.showbase.DirectObject.DirectObject: accept, acceptOnce, addTask, classTree, detectLeaks, doMethodLater, getAllAccepting, ignore, ignoreAll, isAccepting, isIgnoring, removeAllTasks, removeTask

Class Variables
  DEFAULT_COLOR = Vec4(0.68, 0.68, 0.98, 1)

Inherited from direct.fsm.FSM.FSM: SerialNum, defaultTransitions, notify

Method Details

__init__(self, game, name='Player', parent=render, pos2D=(0, 0), profile=AgentProfile(AgentProfile.manProfile), preferences=AgentPreferences(AgentPreferences.noPreferences))
(Constructor)

 

Setup Avatar. The default values load person model, but this can be easily changed.

Overrides: direct.showbase.DirectObject.DirectObject.__init__

__str__(self)
(Informal representation operator)

 

Print out something useful about the fsm

Overrides: direct.fsm.FSM.FSM.__str__
(inherited documentation)

updateWhenRemote(self, dt)

 

Main updater for remotely controlled avatar. Updating of position and orientation are skipped and left to MainEngine and Client classes. Basically a smoothMover is externally used in order to compute smoothed and predicted pos and hpr for a remotely controlled avatar.

updateFiniteStateMachine(self, dt)

 

Behavioral high level rules modeled as a state machine. These rules decide what action perfomes next and therefore describe a level of reasoning above the steering behavior level.

updateEyesOrientation(self, dt)

 

Very first attempt of implementing eyes rotation and pointing system.

NOTE: In the current implementation eyes are rotated instantaneously.

animateWithDesiredVelocity(self)

 

Control animation updating using a motivation. Here desired velocity will select different animation at different play rates based on its intensity

spanDirections(self, spanning)

 

This function return a subset of isb directions indexes spanned by a fan centered along the forward axis with angular extension spannig. Notice that this function return a list of indexes and not directions.

initSetOfCosts(self, c=0.0, m=1.0)

 

Create and initialize a set of costs for later user. Set c and m if you want to initiziale the set with a particular cost and magnitude.

createSteeringBehavior(self, behaviorName, behaviorTask, priority=1, weight=1.0, tStep=0.0, profile={})

 

Create a new steering behavior to be activated when needed. For each behavior specify a unique name and task to executed each time step (behavior period). Specify priority and weight to use during forces combination/evaluation step.

startSteeringBehavior(self, type, delay=0.0, timer=0.0, start=0.0, end=0.0, uponStop=None, restart=False, name=None, **vars)

 

Run an instance of behavior. Type must be chosen from the available set of behaviors and specifies a task to implement the behavior as well as default values for the behavior priority and weight and a defaul behavior's profile. Set a delay time if you want to posticipate the behavior execution. Set a timer if you want to run the instance for a certain time. Set delay=0 if you want to run the instance immediatelly. Set timer=0 if you want to continously update the behavior untill it will get stopped (usally by the internal logic of the behavior's task). Alternativelly, use start and end to directly set starting and ending time for the execution of behavior's instance. Times are always in seconds. If given, the uponStop produce will be called when the instance stops. Set the restart flag if you want to stop all the previously running instances of the given behavior type before running a new one. Use the name parameter to set a name for the behavior's instance. Use vars to set the value of variables in the behavior's profile.

IMPORTANT NOTE: in the current implementation the behavior key is generated simply by incrementation of an int variable.

requestStartBehavior(self, caller, type, **vars)

 

Request to run a behavior from an external caller module. An external caller cannot run multiple instances of the same behavior type, therefore requests for running behaviors will be denied. An external caller can use vars to set variables for the behavior profile.

requestStopBehavior(self, caller, type)

 

Request to stop a behavior from an external caller. If the caller never asked for running the behavior then the stopping request won't take any effect.

stopSteeringBehavior(self, bhvId)

 

Stop execution of a behavior's instance. The bhvId could be the instance key or the instance name. The uponProc procedure will be called after stopping the instance's execution.

IMPORTANT NOTE: in the current implementation the behavior stopping will take place on the next steering layer update step and not immediately.

stopBehaviorLater(self, bhvKey, time)

 

Stop a behavior's instance after a given time.

NOTE: this is a sperimental function which is intended to be used exclusively by the behavior logic.

convertForceIntoCosts(self, force)

 

This function is meant for converting the most common result of a steering function into the correspondent result of an inverse steering function. Given a motivational force towad a goal, this function assigns costs to isb directions based on the angular distance between them and the optimistic optimal (normalized force). Use this function to convert the result of a steering function or as building block for inverse steering functions.

linearlyCombineHighestPriority(self, forces)

 

Linearly combine forces produced by the highest priority behaviors. When the highest priority behavior is just one its pure force is returned without rescaling by weight.

chooseHighestPriority(self, forces)

 

Return the force produced by the highest priority behavior. In case multiple choice the last force with highest priority is choosen.

steerForArrival(self, target, slowing_distance)

 

This steering function compute a desired velocity toward the target. The velocity starts to diminish as soons as the slowing_distance is reachead producing a smooth arrival to the target point.

steerForMinDistance(self, neighborhood, numNeighbors, maxDistance)

 

This steering function compute a repulsion force away from a group of given neighbors. The given maxDistance is the radius of the neighborhood. The magnitude of the resulting force depends from the maxDistance and the distance of the closest neighbor.

steerForKeepGroupSpace(self, neighborhood, numNeighbors, minDistance, maxDistance)

 

This steering function compute a group space force that motivates an agent in keeping a mean equal distance from the neighborhood central point. The mean distance is the mean of neighbors' distances from the group's center. Therefore, the group space force could be an attractive or repulsive force depending from the agent's position. Min and max distances are used to specify the min and max allowed distances from the group's center.

steerForCohesion(self, neighborhood, numNeighbors, point=None, distance_offset=0)

 

This steering function compute a cohesion force that motivate and agent in moving toward its neighborhood to avoid being isolated. Differently from Reynolds version, here is possible to specify a particular attraction point if necessary. An attraction point will turn usefull when the agent is member of a static group instead of a moving one, eg. conversations, queues, etc. Setup a distance offset to set an attraction area instead of an attraction point. Basically, the agent will try to reach the edge of the circle of center point (or neighborhood's center) and radius distance_offset.

steerForAvoidObstacle(self, obstaclePos, obstacleRadius, minTimeToCollision=5.0, radius=None)

 

This steering function compute a desired direction to motivate an agent in avoiding a potential collision with an obstacle. The obstacle must be enclosed in a bounding sphere. In order to detect a potential threat, a collision rectangular probe is defined in front of the agent. Avoidance force tries to keep that rectangular area free from the obstacle.

steerForAvoidObstacles(self, obstacleGroup, numObstacles, minTimeToCollision=5.0, radius=None)

 

This steering function compute a desired direction to motivate an agent in avoiding a potential collision with a group of obstacles. The avoidence force is computed only for the nearest obstacle. Each obstacle must be enclosed in a bounding sphere. In order to detect a potential threat, a collision rectangular probe is defined in front of the agent. Avoidance force tries to keep that rectangular area free from obstacles.

NOTE1: obstacles in this implementation are intended as *fixed* (speed == 0) and *sparse* (dist between two of them > minDist)

NOTE2: extension to different obstacle shapes is mandatory. For fixed obstacles such as walls and stairs we could have a representation of them on grid map as in Terzoupolus (Autonoumus Pedestrian)

VERY IMPORTANT NOTE: this IS NOT the best way of performing collision avoidance. The main reason is that avoidance force depends only from the position of the nearest obstacle. What if this force will drive the agent toward another obstacle? Possible solutions are Inverse Steering Behaviors or flow dynamic.

steerForFacing(self, neighborhood, numNeighbors)

 

This steering function compute a desired direction to rotate an agent in order to make it face the neighborhood. That is, to have the best orientation for facing as much as possible the group of neighbors.

ContainmentAreaBehavior(self, bhv, area)

 

Stay within a given Area containing a polygonal boundary representation. If the projected point (direction of movement) falls outside the bounds, steer against it.

MoveToQueueBehavior(self, bhv, queue)

 

Move towards the queue center. If you get closer than a certain threshold, stop the bhv and start StayInQueue.

StayInQueueBehavior(self, bhv, queue)

 

If the avatar is in the queue and not first in line, it takes a spot behind the avatar right before it (according to the queue's participants list), with an offset depending on the personal queuingDistance and the general queuing direction. If the avatar is first in line, it moves to what is defined in the Queue as the spot for the first in line. If the avatar is being served, it stops this behavior and starts Locomotion towards the serving spot.

LocomotionBehavior(self, bhv, target, slowing_distance, approach_distance, speed, obAvoid)

 

This behavior moves the agent toward a target point, which could be static or dynamic (eg. another agent). If the target is dynamic then the agent will stop at a given approaching distance. If the target is static then the agent will start to slow down at a given slowing distance.

NOTE: in the current implementation obstacle avoidance is stopped (if eventually running) when the agent is 5m close to the target.

HeadTurningBehavior(self, bhv, target)

 

This behavior turn the agent's head toward a given target (usually another agent). NOTE: this behavior was primarly intended for testing purpouses.

LookAtBehavior(self, bhv, target, duration, lazy)

 

This behavior task let the agent look at a given target. Target could be another dynamical object (eg. another agent) or given direction. The agent will perfom posture change in order to look at the target in a comfortable-looking way.

KeepPersonalDistanceBehavior(self, bhv)

 

This behavior will induce an agent in keeping a personal distance from its neighbors. At the moment, the neighborhood is the group of people in the agent personal and intimate zone.

KeepConversationalEqualityBehavior(self, bhv)

 

This behavior will induce an agent in keeping social equality in an ongoing conversation. Social equality means having a positional and orientational behavior that foster equal access to the conversation's o-space.

KeepConversationalCommonAttentionBehavior(self, bhv)

 

This behavior induce and agent in having the same attention behavior of the other participants in the conversation.

TODO: check it better cause it doesn't seem to work all the time

AvoidRegionBehavior(self, bhv, territory)

 

This is a new and more general version of passerby region avoidance. It is meant to work on every human territory and not just with conversations.

KeepConversationalDomainAwarenessBehavior(self, bhv)

 

This behavior let an agent engaged in a conversation aware of the conversation domain, that is aware of who or what is moving close enough to the conversation and of the other participants themselves.

TODO: extend this behavior!

ResponseBehavior(self, bhv)

 

A simple behavior making the agents respond to each other
according to their standings towards each other

Standing value 5 to 10:   Look at target for "a short" time and
                          turn slightly towards
Standing value 0 to 4:    Glance at
Standing value -5 to -1:  Glance at and quickly glance away
Standing value -10 to -6: Turn towards and stare down :)

July 2009: Just starting on this behavior TODO: finish implementation /birna

focusOn(self, target=None, priority=None, caller=None)

 

Focus on target higher level behavior interface. Command an agent to look and stay focused on a given target. Target can be another object or a direction in local coordinates. Use priority override the default behavior priority or caller to propagate priority and weight from a calling behavior. Notice that focus on nothing (target == None) means to un-focus from the previous target.

glanceAt(self, target=None, duration=2.0, priority=None, caller=None, name=None)

 

Glance at target higher level behavior interface. Command an agent to quickly glace at a given target. Target can be another object or a direction in local coordinates. Use priority to override the default behavior priority or caller to propagate priority and weight from a calling behavior. Set a unique name if you want to refer to behavior's instance later on. The target will be memorized in the short time memory for 7 sec.

gazeAt(self, target=None, duration=0.0, priority=None, caller=None, name=None)

 

Gaze at target higher level behavior interface. Command an agent to gaze at a given target. Target can be another object or a direction in local coordinates. Use priority to override the default behavior priority or caller to propagate priority and weight from a calling behavior.

faceTo(self, dir, duration=0.0, priority=None, caller=None)

 

NOTE: this behavior to keep compativility with the code in YTTMPopulus.py

Face to direction higher level behavior interface. Command an agent a given direction as if it is looking there. Target must be a direction in local coordinates. Use priority to override the default behavior priority or caller to propagate priority and weight from a calling behavior.

moveTo(self, target)

 

Move to destination higher level behavior interface. Command an agent to move and reach the given target while avoiding obstacles. Target can be another object or a destination point in the global coordinates system. If target is another dynamic object then the avatar will approach it and stop at a given distance.

turnToward(self, target)

 

Turn body higher level behavior interface. Command an agent to turn the whole body toward a given target. Target can be another object or a direction in the global coordinate system.

turnHeadToward(self, target)

 

Turn head higher level behavior interface. Command an agent to turn its head toward a given target. Target can be another object or a direction in agent local coordinate system.

leaveQueue(self, queue)

 

Go to some spot away from the queue, fixed for now. TODO: Make it relative to the Prop, depending on a prob attrib.

say(self, text, stop=None)

 

Say something to the target. It is way to address the target.

inviteToConversation(self, conversation)

 

Invite an avatar to join the given conversation. Here the avatar should reason about to join or not to join. At the moment it wants always to join.