Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

RS::AmIFirstToBall Class Reference

Tests if the agent will be the first player to reach the ball. More...

Inheritance diagram for RS::AmIFirstToBall:

Inheritance graph
[legend]
Collaboration diagram for RS::AmIFirstToBall:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AmIFirstToBall (bool includeTeammates=true, float assumeSpeed=5)
 Create a predicate with default behavior.

 AmIFirstToBall (const AmIFirstToBall &obj)
 Creates a predicate that is an exact copy of obj.

virtual ~AmIFirstToBall ()
 Destroys the predicate.

AmIFirstToBall & operator= (const AmIFirstToBall &obj)
 Assignment operator.

virtual FuzzyBool operator() ()
 Function application operator.

virtual FuzzyBool evaluate ()
 Should return the truth value of the predicate.


Protected Member Functions

virtual void update (const UInt32 update_number)
 The update function, should be used to update the value of the predicate if necessary.


Protected Attributes

AgentViewagentView
BallViewballView
PlayerViewplayerView
bool includeTeammates
float assumedSpeed

Detailed Description

Tests if the agent will be the first player to reach the ball.

Including opponents only or all visible players in the test is optional. For now, it assumes that all players will keep their speed towards the ball. (The projection of the speed vector on the line towards the ball) It doesn't yet take the ball speed into account.

We will implement another model that doesn't rely that much on the magnitude of speed vector later.

It will calculate the time towards the ball with the function t = (distance to ball)/ (K1 + Project(SpeedVector(Ball) on Vector(Ball to Player)) * S) where K1 is a speed that all players are assumed to have and S is a function that is 1 for all players but the Agent, for which it is dependent on the current stamina level and distance to the ball.

Unit:
Framework/predicate
Revision
1.5
Author
aip3
Date
2003/11/07 15:02:28

Definition at line 96 of file AmIFirstToBall.h.


Member Function Documentation

AmIFirstToBall & RS::AmIFirstToBall::operator= const AmIFirstToBall &    obj
 

Assignment operator.

Assigns obj to this predicate.

Definition at line 98 of file AmIFirstToBall.cc.

References agentView, assumedSpeed, ballView, includeTeammates, and playerView.

FuzzyBool RS::AmIFirstToBall::operator()   [inline, virtual]
 

Function application operator.

Will call evaluate().

Reimplemented from RS::Predicate.

Definition at line 55 of file AmIFirstToBall.icc.

References evaluate().

void RS::AmIFirstToBall::update const UInt32    update_number [protected, virtual]
 

The update function, should be used to update the value of the predicate if necessary.

The method needUpdate(const UInt32 update_number) can be used to check if the predicate needs to be updated based on the last update number it was updated for.

Not used.

Implements RS::Predicate.

Definition at line 186 of file AmIFirstToBall.cc.


The documentation for this class was generated from the following files:
Generated on Mon Aug 29 08:28:39 2011 for RoboSoc by doxygen1.3-rc3