#include <Pfield.h>
Inheritance diagram for Potentialfield:
Public Member Functions | |
Potentialfield () | |
Constructor. | |
virtual | ~Potentialfield () |
Destructor. | |
virtual void | init () |
Initializes values and / or allocates additional memory for subsequent computations. | |
void | getResult (const PfPose &pose, PotentialfieldResult &result) |
Computes the result of a field. | |
void | getValueArray (double x1, double y1, double x2, double y2, int xSteps, int ySteps, double value[], double &max) |
Computes an array of field values, used by visualization. | |
void | getDirectionArray (double x1, double y1, double x2, double y2, int xSteps, int ySteps, PfVec directions[]) |
Computes an array of gradient directions, used by visualization. | |
PfVec | getFieldVecAt (const PfPose &pose) |
Computes the gradient at a given position. | |
double | getFieldValueAt (const PfPose &pose) |
Computes the field value at a given position. | |
virtual void | addObject (Object *object) |
Adds an object to the field. | |
std::string | getName () const |
Returns the name of the field. | |
virtual BehaviorFieldType | getBehaviorFieldType () const=0 |
Returns the type of the field. | |
void | setTimeConstraints (KeepType whatToKeep, ChangeType keepForN, int n, ChangeType blockForM, int m, ChangeType keepMaxForO, int o) |
Sets the time constraints. | |
void | setCriterion (Criterion criterion, double value=0) |
Sets the validity criterion. | |
std::vector< std::string > | getCombinedFields () const |
Returns the names of the fields, this field is combined with. | |
void | addCombinedField (const std::string &fieldName) |
Adds the name of a field, this field is combined with. | |
bool | isCombined () |
Returns whether the field is combined with other fields or not. | |
void | setSelectionFeedback (bool selected) |
Gives the field information about being selected or not. | |
bool | hasToRemainActive () |
Checks, if the field is still blocking other fields. | |
void | setActivation (bool isActive) |
Activates and / or deactivates the field. | |
Protected Member Functions | |
virtual void | execute (const PfPose &pose, PotentialfieldResult &result)=0 |
Computes the result of a field. | |
bool | isBlocked () |
Checks if the field is blocked and cannot compute a result. | |
void | checkForBlockAppliance () |
Checks if the field has to be blocked in future and sets a block if necessary. | |
Protected Attributes | |
std::vector< Object * > | objects |
The objects assigned to this field. | |
std::string | name |
The name of the field. | |
Criterion | criterion |
The criterion for result computation. | |
double | criterionParameter |
An additional parameter for criterion. | |
std::vector< std::string > | combinedFields |
The names of the combined fields. | |
PotentialfieldResult | lastResult |
The last result computed by this field. | |
KeepType | whatToKeep |
Describes what to keep: result or field. | |
ChangeType | keepForN |
Keep for n CALLS or MILLISECONDS. | |
unsigned int | n |
The value corresponding to keepForN. | |
ChangeType | blockForM |
Block for m CALLS or MILLISECONDS. | |
unsigned int | m |
The value corresponding to blockForM. | |
ChangeType | keepMaxForO |
Keep this field at most for o CALLS or MILLISECONDS. | |
int | o |
The value corresponding to keepMaxForO. | |
bool | currentlySelected |
Describes, if the field has been selected last turn. | |
unsigned long | selectedSince |
Describes how long this field has been selected. | |
unsigned long | selectedCalls |
Describes how often this field has been selected. | |
unsigned long | block |
Describes whether calls to be blocked or the point of time until the block is active. | |
bool | isActive |
Flag: True, if the field is active and executable. |
Definition at line 44 of file Pfield.h.
|
Constructor.
Definition at line 19 of file Pfield.cpp. References block, currentlySelected, and isActive. |
|
Destructor.
Definition at line 27 of file Pfield.cpp. References combinedFields. |
|
Initializes values and / or allocates additional memory for subsequent computations. This function should be called after all values are set and all objects have been assigned Reimplemented in Actionfield. Definition at line 56 of file Pfield.h. Referenced by PotentialfieldComposition::addField(). |
|
Computes the result of a field.
Definition at line 219 of file Pfield.cpp. References PotentialfieldResult::action, PotentialfieldResult::actionPossible, CALLS, currentlySelected, execute(), getSystemTime(), isActive, isBlocked(), KEEP_RESULT, keepForN, lastResult, MILLISECONDS, selectedCalls, selectedSince, PotentialfieldResult::timeStamp, and whatToKeep. |
Here is the call graph for this function:
|
Computes an array of field values, used by visualization.
Definition at line 34 of file Pfield.cpp. References getFieldValueAt(), max, min, PfPose::pos, PfVec::x, and PfVec::y. Referenced by PotentialfieldComposition::getValueArray(). |
Here is the call graph for this function:
|
Computes an array of gradient directions, used by visualization.
Definition at line 71 of file Pfield.cpp. References getFieldVecAt(), PfVec::length(), PfVec::normalize(), PfPose::pos, PfVec::x, and PfVec::y. Referenced by PotentialfieldComposition::getDirectionArray(). |
Here is the call graph for this function:
|
Computes the gradient at a given position.
Definition at line 95 of file Pfield.cpp. References getBehaviorFieldType(), and MOTION_FIELD. Referenced by Motionfield::execute(), getDirectionArray(), and Motionfield::pathPlanningStillNeeded(). |
Here is the call graph for this function:
|
Computes the field value at a given position.
Definition at line 111 of file Pfield.cpp. Referenced by getValueArray(), and PotentialfieldAStarNode::setValueAtPos(). |
|
Adds an object to the field.
Reimplemented in Actionfield. Definition at line 104 of file Pfield.h. Referenced by Parser::addGroupToField(), Actionfield::addObject(), and Parser::parseObjectsForField(). |
|
Returns the name of the field.
Definition at line 110 of file Pfield.h. Referenced by PotentialfieldComposition::addField(). |
|
Returns the type of the field.
Implemented in Actionfield, and Motionfield. Referenced by getFieldVecAt(). |
|
Sets the time constraints.
Definition at line 127 of file Pfield.h. Referenced by Parser::parseTimeConstraintsForField(). |
|
Sets the validity criterion.
Definition at line 143 of file Pfield.h. References criterionParameter. Referenced by Parser::parseActionfield(), and Parser::parseMotionfield(). |
|
Returns the names of the fields, this field is combined with.
Definition at line 149 of file Pfield.h. References combinedFields. |
|
Adds the name of a field, this field is combined with.
Definition at line 155 of file Pfield.h. References combinedFields. Referenced by Parser::parseActionfield(), and Parser::parseMotionfield(). |
|
Returns whether the field is combined with other fields or not.
Definition at line 161 of file Pfield.h. References combinedFields. |
|
Gives the field information about being selected or not.
Definition at line 123 of file Pfield.cpp. References checkForBlockAppliance(), currentlySelected, getSystemTime(), selectedCalls, and selectedSince. |
Here is the call graph for this function:
|
Checks, if the field is still blocking other fields.
Definition at line 202 of file Pfield.cpp. References CALLS, currentlySelected, getSystemTime(), keepForN, selectedCalls, and selectedSince. |
Here is the call graph for this function:
|
Activates and / or deactivates the field.
|
|
Computes the result of a field.
Implemented in Actionfield, and Motionfield. Referenced by getResult(). |
|
Checks if the field is blocked and cannot compute a result.
Definition at line 150 of file Pfield.cpp. References block, blockForM, CALLS, and getSystemTime(). Referenced by getResult(). |
Here is the call graph for this function:
|
Checks if the field has to be blocked in future and sets a block if necessary.
Definition at line 167 of file Pfield.cpp. References block, blockForM, CALLS, currentlySelected, getSystemTime(), keepMaxForO, m, o, selectedCalls, and selectedSince. Referenced by setSelectionFeedback(). |
Here is the call graph for this function:
|
The objects assigned to this field.
|
|
The name of the field.
|
|
The criterion for result computation.
|
|
An additional parameter for criterion.
Definition at line 188 of file Pfield.h. Referenced by setCriterion(). |
|
The names of the combined fields.
Definition at line 190 of file Pfield.h. Referenced by addCombinedField(), getCombinedFields(), isCombined(), and ~Potentialfield(). |
|
The last result computed by this field.
Definition at line 192 of file Pfield.h. Referenced by getResult(). |
|
Describes what to keep: result or field.
Definition at line 194 of file Pfield.h. Referenced by getResult(). |
|
Keep for n CALLS or MILLISECONDS.
Definition at line 196 of file Pfield.h. Referenced by getResult(), and hasToRemainActive(). |
|
The value corresponding to keepForN.
|
|
Block for m CALLS or MILLISECONDS.
Definition at line 200 of file Pfield.h. Referenced by checkForBlockAppliance(), and isBlocked(). |
|
The value corresponding to blockForM.
Definition at line 202 of file Pfield.h. Referenced by checkForBlockAppliance(). |
|
Keep this field at most for o CALLS or MILLISECONDS.
Definition at line 204 of file Pfield.h. Referenced by checkForBlockAppliance(). |
|
The value corresponding to keepMaxForO.
Definition at line 206 of file Pfield.h. Referenced by checkForBlockAppliance(). |
|
Describes, if the field has been selected last turn.
Definition at line 208 of file Pfield.h. Referenced by checkForBlockAppliance(), getResult(), hasToRemainActive(), Potentialfield(), and setSelectionFeedback(). |
|
Describes how long this field has been selected.
Definition at line 210 of file Pfield.h. Referenced by checkForBlockAppliance(), getResult(), hasToRemainActive(), and setSelectionFeedback(). |
|
Describes how often this field has been selected.
Definition at line 212 of file Pfield.h. Referenced by checkForBlockAppliance(), getResult(), hasToRemainActive(), and setSelectionFeedback(). |
|
Describes whether calls to be blocked or the point of time until the block is active.
Definition at line 214 of file Pfield.h. Referenced by checkForBlockAppliance(), isBlocked(), and Potentialfield(). |
|
Flag: True, if the field is active and executable.
Definition at line 216 of file Pfield.h. Referenced by getResult(), and Potentialfield(). |