BestFitFormation Class Reference

#include <FormationObject.h>

Inheritance diagram for BestFitFormation:

SingleFormation List of all members.

Public Member Functions

 BestFitFormation ()
 ~BestFitFormation ()
bool isActive () const
bool isStatic () const
virtual PfVec getPosition (const PfPose &robotPose)
PfVec getVec (const PfPose &otherPose)
double getCharge (const PfPose &otherPose)
void addFormation (SingleFormation *formation)
void setBestFitSelection (BestFitSelection bestFitSelection)
SingleFormationcopy () const

Protected Member Functions

virtual void updateGeometry ()
int findBestFormation (const PfPose &otherPose)

Protected Attributes

std::vector< SingleFormation * > formations
std::vector< PfVecresultVecs
std::vector< double > resultDistances
BestFitSelection bestFitSelection

Detailed Description

A class representing a formation selection the "best fitting" formation out of a set of SingleFormations.

Definition at line 235 of file FormationObject.h.


Constructor & Destructor Documentation

BestFitFormation::BestFitFormation (  ) 

Constructor

Definition at line 234 of file FormationObject.cpp.

Referenced by copy().

BestFitFormation::~BestFitFormation (  ) 

Destructor

Definition at line 239 of file FormationObject.cpp.

References formations.


Member Function Documentation

void BestFitFormation::addFormation ( SingleFormation formation  )  [inline]

Adds a single formation to the set of formations

Parameters:
formation The formation

Definition at line 276 of file FormationObject.h.

References formations, resultDistances, and resultVecs.

Referenced by copy(), and Parser::parseFormationObject().

SingleFormation * BestFitFormation::copy (  )  const [virtual]

Creates a copy of the formation object

Returns:
A pointer to a copy

Reimplemented from SingleFormation.

Definition at line 397 of file FormationObject.cpp.

References addFormation(), BestFitFormation(), bestFitSelection, formations, resultDistances, and resultVecs.

int BestFitFormation::findBestFormation ( const PfPose otherPose  )  [protected]

Determines the best formation

Parameters:
otherPose The pose to find the bestFormationFor
Returns:
The index of the best formation, -1 if none exists

Definition at line 322 of file FormationObject.cpp.

References bestFitSelection, formations, isActive(), SELECT_MAX_GRADIENT, SELECT_MAX_PRIORITY, SELECT_MIN_DISTANCE, SELECT_MIN_GRADIENT, and val.

Referenced by getCharge(), getPosition(), and getVec().

double BestFitFormation::getCharge ( const PfPose otherPose  )  [virtual]

Returns the field charge of the formation at a given pose

Parameters:
otherPose The pose
Returns:
The charge of the formation

Reimplemented from SingleFormation.

Definition at line 293 of file FormationObject.cpp.

References findBestFormation(), formations, and int().

PfVec BestFitFormation::getPosition ( const PfPose robotPose  )  [virtual]

Returns the position of the formation in reference to the robot pose (used for A*-search to a formation)

Parameters:
robotPose The robot pose
Returns:
The position of the formation

Reimplemented from SingleFormation.

Definition at line 265 of file FormationObject.cpp.

References findBestFormation(), formations, and int().

PfVec BestFitFormation::getVec ( const PfPose otherPose  )  [virtual]

Returns the field vector to/from a formation to/from a given pose

Parameters:
otherPose The pose on which the formation affects
Returns:
The vector

Reimplemented from SingleFormation.

Definition at line 279 of file FormationObject.cpp.

References findBestFormation(), formations, and int().

bool BestFitFormation::isActive (  )  const [virtual]

Checks if the formation is active

Returns:
true, if the formation is active

Reimplemented from SingleFormation.

Definition at line 307 of file FormationObject.cpp.

References formations.

Referenced by findBestFormation().

bool BestFitFormation::isStatic (  )  const [virtual]

Checks if the formation has a static position

Returns:
true, if the formation has a static position

Reimplemented from SingleFormation.

Definition at line 250 of file FormationObject.cpp.

References formations.

void BestFitFormation::setBestFitSelection ( BestFitSelection  bestFitSelection  )  [inline]

Sets the criterion for choosing the best fitting formation

Parameters:
bestFitSelection The selection criterion

Definition at line 286 of file FormationObject.h.

Referenced by Parser::parseFormationObject().

virtual void BestFitFormation::updateGeometry (  )  [inline, protected, virtual]

Updates the positions of the formation

Reimplemented from SingleFormation.

Definition at line 305 of file FormationObject.h.


Member Data Documentation

BestFitSelection BestFitFormation::bestFitSelection [protected]

The selection criterion

Definition at line 302 of file FormationObject.h.

Referenced by copy(), and findBestFormation().

std::vector<SingleFormation*> BestFitFormation::formations [protected]

The set of formations

Definition at line 296 of file FormationObject.h.

Referenced by addFormation(), copy(), findBestFormation(), getCharge(), getPosition(), getVec(), isActive(), isStatic(), and ~BestFitFormation().

std::vector<double> BestFitFormation::resultDistances [protected]

A list of distances corresponding to the formations

Definition at line 300 of file FormationObject.h.

Referenced by addFormation(), and copy().

std::vector<PfVec> BestFitFormation::resultVecs [protected]

A list of vectors corresponding to the formations

Definition at line 298 of file FormationObject.h.

Referenced by addFormation(), and copy().


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:19:19 2006 for DT2005.panorama by  doxygen 1.4.7