#include <FormationObject.h>
Inheritance diagram for BestFitFormation:
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) |
SingleFormation * | copy () const |
Protected Member Functions | |
virtual void | updateGeometry () |
int | findBestFormation (const PfPose &otherPose) |
Protected Attributes | |
std::vector< SingleFormation * > | formations |
std::vector< PfVec > | resultVecs |
std::vector< double > | resultDistances |
BestFitSelection | bestFitSelection |
Definition at line 235 of file FormationObject.h.
BestFitFormation::BestFitFormation | ( | ) |
BestFitFormation::~BestFitFormation | ( | ) |
void BestFitFormation::addFormation | ( | SingleFormation * | formation | ) | [inline] |
Adds a single formation to the set of formations
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
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
otherPose | The pose to find the bestFormationFor |
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
otherPose | The pose |
Reimplemented from SingleFormation.
Definition at line 293 of file FormationObject.cpp.
References findBestFormation(), formations, and int().
Returns the position of the formation in reference to the robot pose (used for A*-search to a formation)
robotPose | The robot pose |
Reimplemented from SingleFormation.
Definition at line 265 of file FormationObject.cpp.
References findBestFormation(), formations, and int().
Returns the field vector to/from a formation to/from a given pose
otherPose | The pose on which the formation affects |
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
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
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
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.
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().