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

# Actionfield Class Reference

A class for selecting an action using potentialfields. More...

`#include <Actionfield.h>`

Inheritance diagram for Actionfield:

[legend]
Collaboration diagram for Actionfield:

[legend]
List of all members.

## Public Member Functions
| Actionfield (const std::string &name)
| Constructor.
virtual | ~Actionfield ()
| Destructor.
virtual void | init ()
| Initializes values and / or allocates additional memory for subsequent computations.
void | execute (const PfPose &pose, PotentialfieldResult &result)
| Computes the result of a field.
virtual void | addObject (PotentialFieldsObject *object)
| Adds an object to the field.
void | addAction (const Action &action)
| Adds an action to the field.
void | setActionfieldType (ActionfieldType actionfieldType, bool decreasingValuesOnly=false, unsigned int searchDepth=0)
| Sets the type of the action field.
void | setConsiderTime (bool considerTime)
| Sets the value of considerTime.
PfVec | getFutureFieldVecAt (const PfPose &pose, const std::vector< PotentialFieldsObject * > &dynamicObjects, int excludedDynamicObject=-1)
| Computes the gradient at a spezific pose in a field consisting of all static objects and all the other, possibly transformed, objects.
BehaviorFieldType | getBehaviorFieldType () const
| Returns the type of the field.
## Protected Member Functions
double | computeValueAtPose (const PfPose &pose, const std::vector< PotentialFieldsObject * > &dynamicObjects, int excludedDynamicObject=-1)
| Computes the value at a spezific pose in a field consisting of all static objects and all the other, possibly transformed, objects.
double | computeActionValue (const Action &action, double time, const PfPose &ownPoseBefore, const PfPose &ownPoseAfter, const std::vector< PotentialFieldsObject * > &objectsBefore, const std::vector< PotentialFieldsObject * > &objectsAfter, bool &passedPruningCheck)
| Computes the value of an action considering the criterion.
void | addManipulatedObject (Action &action)
| Adds a manipulated object to the object lists (if it has not been added before) and sets the objectIdx member of the action.
void | findBestSequence (unsigned int depth, const PfPose &robotPose, std::vector< unsigned int > &actionSequenceList, double time, double previousValue, PotentialfieldResult &result)
| Searches recursively for the best possible action sequence and sets the result.
## Protected Attributes
std::vector< PotentialFieldsObject * > | staticObjects
| Container for static objects.
std::vector< PotentialFieldsObject * > | dynamicObjects
| Container for dynamic objects.
std::vector< std::vector< PotentialFieldsObject * > > | futureWorldStates
| The future world states.
std::vector< PfPose > | futureRobotPoses
| The future poses of the robot.
std::vector< Action > | actions
| The actions to be applied.
FutureWorldModelGenerator * | futureWorldModelGenerator
| A pointer to the FutureWorldModelGenerator.
ActionfieldType | actionfieldType
| The type of this action field.
unsigned int | worldStateDepth
| The depth of future world states.
bool | decreasingValuesOnly
| Pruning option, accept only sequences with decreasing values.
double | maxTolerance
| Pruning option, maximum deviation between two action values.
bool | considerTime
| Flag: true, if the time of an action when computing its value is to be considered.

## Detailed Description

A class for selecting an action using potentialfields.

Definition at line 96 of file Actionfield.h.

## Constructor & Destructor Documentation

Actionfield::Actionfield | ( | const std::string & | name | ) |

| Constructor. Definition at line 140 of file Actionfield.cpp. References futureWorldModelGenerator, and FutureWorldModelGenerator::getFutureWorldModelGenerator().

Here is the call graph for this function:

Actionfield::~Actionfield | ( |  | ) | `[virtual]`

| Destructor. Definition at line 147 of file Actionfield.cpp. References actions, dynamicObjects, futureWorldStates, and worldStateDepth.

## Member Function Documentation

void Actionfield::init | ( |  | ) | `[virtual]`

| Initializes values and / or allocates additional memory for subsequent computations. This function should be called after all values are set and all objects and actions have been assigned Reimplemented from Potentialfield. Definition at line 162 of file Actionfield.cpp. References actionfieldType, actions, addManipulatedObject(), dynamicObjects, FIXED_SEQUENCE_FIELD, futureRobotPoses, futureWorldStates, MEASURE_OBJECT, MOVE_OBJECT, SINGLE_ACTION_FIELD, and worldStateDepth.

Here is the call graph for this function:

void Actionfield::execute | ( | const PfPose & | pose,
|  | PotentialfieldResult & | result
| ) | `[virtual]`

  | Computes the result of a field. Parameters:
  pose | The pose of the robot on which the field affects
  result | The returned result
Implements Potentialfield. Definition at line 236 of file Actionfield.cpp. References actionfieldType, PotentialfieldResult::actionPossible, actions, computeActionValue(), CRITERION_CONST, dynamicObjects, findBestSequence(), FIXED_SEQUENCE_FIELD, futureRobotPoses, futureWorldModelGenerator, futureWorldStates, PotentialfieldResult::motion, SINGLE_ACTION_FIELD, PfPose::speed, staticObjects, PotentialfieldResult::subAction, FutureWorldModelGenerator::transformWorldState(), PotentialfieldResult::value, and worldStateDepth.

Here is the call graph for this function:

void Actionfield::addObject | ( | PotentialFieldsObject * | object | ) | `[virtual]`

  | Adds an object to the field. Parameters:
  object | The object
Reimplemented from Potentialfield. Definition at line 200 of file Actionfield.cpp. References Potentialfield::addObject(), dynamicObjects, PotentialFieldsObject::isStatic(), and staticObjects.

Here is the call graph for this function:

void Actionfield::addAction | ( | const Action & | action | ) |

  | Adds an action to the field. Parameters:
  action | The action
Definition at line 230 of file Actionfield.cpp. References actions. Referenced by Parser::parseActionfield().

void Actionfield::setActionfieldType | ( | ActionfieldType | actionfieldType,
|  | bool | decreasingValuesOnly = false,
|  | unsigned int | searchDepth = 0
| ) | `[inline]`

  | Sets the type of the action field. Parameters:
  actionfieldType | The type
  decreasingValuesOnly | Pruning option, used for sequences
  searchDepth | The searchDepth used if (actionfieldType==FIND_BEST_SEQUENCE)
Definition at line 131 of file Actionfield.h. References decreasingValuesOnly, and worldStateDepth. Referenced by Parser::parseActionfield().

void Actionfield::setConsiderTime | ( | bool | considerTime | ) | `[inline]`

  | Sets the value of considerTime. Parameters:
  considerTime | The new value for considerTime
Definition at line 141 of file Actionfield.h. Referenced by Parser::parseActionfield().

PfVec Actionfield::getFutureFieldVecAt | ( | const PfPose & | pose,
|  | const std::vector< PotentialFieldsObject * > & | dynamicObjects,
|  | int | excludedDynamicObject = -1
| ) |

  | Computes the gradient at a spezific pose in a field consisting of all static objects and all the other, possibly transformed, objects. Parameters:
  pose | The pose to compute the gradient at
  dynamicObjects | A set of objects
  excludedDynamicObject | An object not to use for gradient computation
Returns: The gradient at pose Definition at line 403 of file Actionfield.cpp. References staticObjects. Referenced by FutureWorldModelGenerator::executeSingleTransformation().

BehaviorFieldType Actionfield::getBehaviorFieldType | ( |  | ) | const`[inline, virtual]`

| Returns the type of the field. Returns: The type Implements Potentialfield. Definition at line 157 of file Actionfield.h. References ACTION_FIELD, and BehaviorFieldType.

double Actionfield::computeValueAtPose | ( | const PfPose & | pose,
|  | const std::vector< PotentialFieldsObject * > & | dynamicObjects,
|  | int | excludedDynamicObject = -1
| ) | `[protected]`

  | Computes the value at a spezific pose in a field consisting of all static objects and all the other, possibly transformed, objects. Parameters:
  pose | The pose to compute the value at
  dynamicObjects | A set of objects
  excludedDynamicObject | An object not to use for value computation
Returns: The value at pose Definition at line 373 of file Actionfield.cpp. References staticObjects. Referenced by computeActionValue().

double Actionfield::computeActionValue | ( | const Action & | action,
|  | double | time,
|  | const PfPose & | ownPoseBefore,
|  | const PfPose & | ownPoseAfter,
|  | const std::vector< PotentialFieldsObject * > & | objectsBefore,
|  | const std::vector< PotentialFieldsObject * > & | objectsAfter,
|  | bool & | passedPruningCheck
| ) | `[protected]`

  | Computes the value of an action considering the criterion. Parameters:
  action | The action
  time | The execution of the action / action sequence
  ownPoseBefore | The robot pose before the action
  ownPoseAfter | The robot pose after the action
  objectsBefore | The state of the objects before the action
  objectsAfter | The state of the objects after the action
  passedPruningCheck | Flag: true, if the action has not to be pruned
Returns: The value Definition at line 433 of file Actionfield.cpp. References Action::actionType, computeValueAtPose(), considerTime, CRITERION_ABSOLUTE, CRITERION_GAIN, decreasingValuesOnly, EPSILON, MEASURE_OBJECT, MEASURE_SELF, MOVE_OBJECT, MOVE_SELF, and Action::objectIdx. Referenced by execute(), and findBestSequence().

Here is the call graph for this function:

void Actionfield::addManipulatedObject | ( | Action & | action | ) | `[protected]`

  | Adds a manipulated object to the object lists (if it has not been added before) and sets the objectIdx member of the action. Parameters:
  action | The action manipulating the object
Definition at line 214 of file Actionfield.cpp. References dynamicObjects, Action::manipulatedObject, and Action::objectIdx. Referenced by init().

void Actionfield::findBestSequence | ( | unsigned int | depth,
|  | const PfPose & | robotPose,
|  | std::vector< unsigned int > & | actionSequenceList,
|  | double | time,
|  | double | previousValue,
|  | PotentialfieldResult & | result
| ) | `[protected]`

  | Searches recursively for the best possible action sequence and sets the result. Parameters:
  depth | The current depth
  robotPose | The pose of the robot before any actions
  actionSequenceList | A list with the sequence of actions
  time | The time of the previous sequence
  previousValue | The previous value of the sequence
  result | The currently best result of the search
Definition at line 331 of file Actionfield.cpp. References actions, computeActionValue(), dynamicObjects, futureRobotPoses, futureWorldModelGenerator, futureWorldStates, PotentialfieldResult::motion, staticObjects, PotentialfieldResult::subAction, FutureWorldModelGenerator::transformWorldState(), PotentialfieldResult::value, and worldStateDepth. Referenced by execute().

Here is the call graph for this function:

## Member Data Documentation

std::vector<PotentialFieldsObject*> Actionfield::staticObjects`[protected]`

| Container for static objects. Definition at line 162 of file Actionfield.h. Referenced by addObject(), computeValueAtPose(), execute(), findBestSequence(), and getFutureFieldVecAt().

std::vector<PotentialFieldsObject*> Actionfield::dynamicObjects`[protected]`

| Container for dynamic objects. Definition at line 164 of file Actionfield.h. Referenced by addManipulatedObject(), addObject(), execute(), findBestSequence(), init(), and ~Actionfield().

std::vector< std::vector<PotentialFieldsObject*> > Actionfield::futureWorldStates`[protected]`

| The future world states. Definition at line 166 of file Actionfield.h. Referenced by execute(), findBestSequence(), init(), and ~Actionfield().

std::vector< PfPose > Actionfield::futureRobotPoses`[protected]`

| The future poses of the robot. Definition at line 168 of file Actionfield.h. Referenced by execute(), findBestSequence(), and init().

std::vector<Action> Actionfield::actions`[protected]`

| The actions to be applied. Definition at line 170 of file Actionfield.h. Referenced by addAction(), execute(), findBestSequence(), init(), and ~Actionfield().

FutureWorldModelGenerator* Actionfield::futureWorldModelGenerator`[protected]`

| A pointer to the FutureWorldModelGenerator. Definition at line 172 of file Actionfield.h. Referenced by Actionfield(), execute(), and findBestSequence().

ActionfieldType Actionfield::actionfieldType`[protected]`

| The type of this action field. Definition at line 174 of file Actionfield.h. Referenced by execute(), and init().

unsigned int Actionfield::worldStateDepth`[protected]`

| The depth of future world states. Definition at line 176 of file Actionfield.h. Referenced by execute(), findBestSequence(), init(), setActionfieldType(), and ~Actionfield().

bool Actionfield::decreasingValuesOnly`[protected]`

| Pruning option, accept only sequences with decreasing values. Definition at line 178 of file Actionfield.h. Referenced by computeActionValue(), and setActionfieldType().

double Actionfield::maxTolerance`[protected]`

| Pruning option, maximum deviation between two action values. Definition at line 180 of file Actionfield.h.

bool Actionfield::considerTime`[protected]`

| Flag: true, if the time of an action when computing its value is to be considered. Definition at line 182 of file Actionfield.h. Referenced by computeActionValue().

The documentation for this class was generated from the following files:

- Tools/PotentialFields/Actionfield.h
- Tools/PotentialFields/Actionfield.cpp