#include <predicate.h>
Collaboration diagram for oxygen::Predicate:
Public Member Functions | |
const Iterator | begin () const |
bool | FindParameter (Iterator &iter, const std::string &name) const |
find a parameter with a given name. | |
template<typename T> | |
f_inline bool | GetValue (const Iterator &iter, const std::string &name, T &value) const |
finds and returns the first value of a parameter with a given name. | |
template<typename T> | |
f_inline bool | AdvanceValue (Iterator &iter, const std::string &name, T &value) const |
finds and returns the first value of a parameter with a given name. | |
template<typename T> | |
f_inline bool | AdvanceValue (Iterator &iter, T &value) const |
AdvanceValue tries to cast the parameter at iter to a value of type T. | |
template<typename T> | |
f_inline bool | GetValue (const Iterator &iter, T &value) const |
GetValue has the same semantics as AdvanceValue except that it takes a const reference to iter that it does not increment. | |
template<typename T> | |
f_inline bool | GetAnyValue (const Iterator &iter, T &value) const |
bool | DescentList (Iterator &iter) const |
tries to inteprete the value iter points to as a ParameterList and points iter to it's first element. | |
Public Attributes | |
std::string | name |
the name of this predicate | |
zeitgeist::ParameterList | parameter |
the list of parameter values | |
Static Protected Attributes | |
static const zeitgeist::ParameterList | nullParamList |
The null element for Predicate::Iterator. | |
Classes | |
class | Iterator |
ParameterList::TVectr::const_iterator together with a reference to the ParameterList the iterator belongs to. More... |
It is used as an internal representation for commands issued by agents and is interpreted by Effector classes. A BaseParser object is responsible to translate the received agent commands into a list of Predicates. An Effector is therefore independent from the command format used between an agent and the simulator.
Predicates are further used to collect sensor data from the agents perceptors. A BaseParser is then used to translate these percepts into the format used to describe them to the corresponding agent. Again, the Perceptor is independent from the format used to transmit its data to the agent.
Definition at line 49 of file predicate.h.
|
AdvanceValue tries to cast the parameter at iter to a value of type T. If successful it returns true, assigns the casted parameter to value and increments the iterator iter. Otherwise false is returned and value and iter are unchanged. Definition at line 201 of file predicate.h. References zeitgeist::ParameterList::AdvanceValue(), oxygen::Predicate::Iterator::GetIterator(), and oxygen::Predicate::Iterator::GetList(). Here is the call graph for this function: ![]() |
|
finds and returns the first value of a parameter with a given name. On success value contains the first parameter value and iter points to the second parameter value Definition at line 185 of file predicate.h. References FindParameter(). Referenced by UniversalJointEffector::GetActionObject(), SayEffector::GetActionObject(), PanTiltEffector::GetActionObject(), KickEffector::GetActionObject(), HingeEffector::GetActionObject(), Hinge2Effector::GetActionObject(), and GetValue(). Here is the call graph for this function: ![]() |
|
Definition at line 126 of file predicate.h. References zeitgeist::ParameterList::begin(), and parameter. Referenced by UniversalJointEffector::GetActionObject(), SceneEffector::GetActionObject(), SayEffector::GetActionObject(), PanTiltEffector::GetActionObject(), KickEffector::GetActionObject(), InitEffector::GetActionObject(), HingeEffector::GetActionObject(), Hinge2Effector::GetActionObject(), ForceEffector::GetActionObject(), DriveEffector::GetActionObject(), and BeamEffector::GetActionObject(). Here is the call graph for this function: ![]() |
|
tries to inteprete the value iter points to as a ParameterList and points iter to it's first element. Returns true on success Definition at line 166 of file predicate.cpp. References oxygen::Predicate::Iterator::GetIterator(). Here is the call graph for this function: ![]() |
|
find a parameter with a given name. For this method, we assume that parameters are represented by lists consisting of a name (a string) and (a number of) values. An example for the predicate init: init.name = "init"; init.parameter = [["teamname", "RoboLog"], ["unum", 1]]; The part after init is the list of parameters. To extract the teamname, do something like Predicate::iterator iter(myPredicate); if (FindParameter(iter, "teamname")) { GetValue(iter,name); }
Referenced by AdvanceValue(), TrainerCommandParser::ParseBallCommand(), and TrainerCommandParser::ParsePlayerCommand(). |
|
Definition at line 216 of file predicate.h. References zeitgeist::ParameterList::GetAnyValue(), oxygen::Predicate::Iterator::GetIterator(), and oxygen::Predicate::Iterator::GetList(). Here is the call graph for this function: ![]() |
|
GetValue has the same semantics as AdvanceValue except that it takes a const reference to iter that it does not increment.
Definition at line 210 of file predicate.h. References oxygen::Predicate::Iterator::GetIterator(), oxygen::Predicate::Iterator::GetList(), and zeitgeist::ParameterList::GetValue(). Here is the call graph for this function: ![]() |
|
finds and returns the first value of a parameter with a given name. This method tries to cover the most common use case of a ParameterList. It assumes that the parameters are a set lists consisting of name value pairs, e.g. for the predicate init init.name = "init"; init.parameter = [["teamname", "RoboLog"], ["unum", 1]]; For parameter entries with more than one value per parameter use the generic FindParameter/GetValue functions.
Definition at line 174 of file predicate.h. References AdvanceValue(). Referenced by SceneEffector::GetActionObject(), InitEffector::GetActionObject(), ForceEffector::GetActionObject(), DriveEffector::GetActionObject(), BeamEffector::GetActionObject(), TrainerCommandParser::ParseBallCommand(), TrainerCommandParser::ParseKickOffCommand(), TrainerCommandParser::ParsePlayerCommand(), and TrainerCommandParser::ParsePlayModeCommand(). Here is the call graph for this function: ![]() |
|
|
The null element for Predicate::Iterator.
Definition at line 234 of file predicate.h. |
|