The base class for parametrized objects (objects with parameters) used by the planning algorithm for state representation.
More...
#include <ParametrizedObject.hh>
|
std::map< std::string, ObjectParameter * > | parameters {} |
|
std::map< std::string, std::set< unsigned int > > | indexCollections {} |
|
MemoryPool * | memory |
|
|
struct | grail::data::PlannerActionSnapshot |
|
The base class for parametrized objects (objects with parameters) used by the planning algorithm for state representation.
◆ AddCollection()
void grail::planner::ParametrizedObject::AddCollection |
( |
const std::string & |
collectionName | ) |
|
Creates a new named collection object under the provided name, which can be used to group many IDs of objects together.
The name should be unique or you will otherwise override an existing collection.
- Parameters
-
collectionName | - the name of the collection that will be created. |
◆ CollectionContains()
bool grail::planner::ParametrizedObject::CollectionContains |
( |
const std::string & |
collectionName, |
|
|
unsigned int |
objectIndex |
|
) |
| const |
- Returns
- true if the object contains objectIndex in a collection identified by collectionName
◆ Contains()
bool grail::planner::ParametrizedObject::Contains |
( |
const std::string & |
paramName | ) |
const |
- Returns
- true if the object contains a parameter with the given name, false otherwise.
◆ GetCollection() [1/2]
std::set< unsigned int > * grail::planner::ParametrizedObject::GetCollection |
( |
const std::string & |
name | ) |
|
- Parameters
-
collectionName | - The name of the collection to retrieve. See "AddCollection". |
- Returns
- The collection with the given name or null if such does not exist.
◆ GetCollection() [2/2]
const std::set< unsigned int > * grail::planner::ParametrizedObject::GetCollection |
( |
const std::string & |
name | ) |
const |
- Parameters
-
collectionName | - the name of the collection to retrieve. See "AddCollection". |
- Returns
- The collection with the given name or null if such does not exist.
◆ GetParametersSize()
std::size_t grail::planner::ParametrizedObject::GetParametersSize |
( |
| ) |
const |
- Returns
- The number of parameters assigned to this object.
◆ GetParameterValue()
template<typename ParameterType >
ParameterType grail::planner::ParametrizedObject::GetParameterValue |
( |
const std::string & |
paramName | ) |
const |
|
inline |
- Returns
- The parameter's value if a parameter with the given name exists, the default value otherwise
◆ HasEqualParams()
bool grail::planner::ParametrizedObject::HasEqualParams |
( |
const ParametrizedObject & |
other | ) |
const |
- Returns
- true if the other object contains identical set of parameters (including the contents of collections).
◆ MergeParameters()
void grail::planner::ParametrizedObject::MergeParameters |
( |
const ParametrizedObject & |
other | ) |
|
MergeParameters - Adds other parameters to the own one, replacing parameter with those of other in case of conflict.
- Parameters
-
other | Object to merge parameters from. |
◆ SetParameter()
template<typename ParameterType >
void grail::planner::ParametrizedObject::SetParameter |
( |
const std::string & |
paramName, |
|
|
const ParameterType & |
paramValue |
|
) |
| |
|
inline |
Updates the value of a parameter identified by the given name. If there's no such parameter, it will be added.
- Parameters
-
paramName | - the name of the parameter. |
paramValue | - the value of the parameter. |
◆ SetSerializeSnapshotFunction()
void grail::planner::ParametrizedObject::SetSerializeSnapshotFunction |
( |
std::function< void(const ParametrizedObject &object, std::map< std::string, std::string > &nameValues)> |
function | ) |
|
SetSerializeSnapshotFunction - Sets a function serializing a snapshot of parameter values to string.
- Parameters
-
function | - serialization function returning a map where keys represent parameter identifiers and values - parameter values serialized to string. |
The documentation for this class was generated from the following files:
- GrailPlanners/Planner/WorldState/ParametrizedObject.hh
- GrailPlanners/Planner/WorldState/ParametrizedObject.cpp