Fawkes API Fawkes Development Version
|
An action representation within an STN. More...
#include "stn_action.h"
Public Member Functions | |
StnAction (const std::string &name, const std::vector< Predicate > &preconds, const std::vector< Predicate > &effects, const std::string &opts, size_t duration=0, const std::vector< std::string > &cond_breakups={}, const std::vector< std::string > &temp_breakups={}) | |
Constructor. More... | |
bool | operator== (const StnAction &o) |
Compare two StnActions. More... | |
bool | operator!= (const StnAction &o) |
Compare two StnActions. More... | |
size_t | id () const |
Get the ID of the action. More... | |
bool | checkForBreakup (EdgeType t, const Predicate &p) const |
Check if the given predicate is a breakup. More... | |
std::vector< size_t > | condActionIds () const |
Get all IDs of this StnAction's conditional actions. More... | |
std::string | genGraphNodeName () const |
Get a string representation of the StnAction for the graph representation. More... | |
std::string | genConditionEdgeLabel (size_t cond_action) const |
Generate an edge label for the graph representation. More... | |
std::string | genTemporalEdgeLabel () const |
Generate a temporal edge for the graph representation. More... | |
void | genConditionalActions (std::vector< StnAction > candidate_actions) |
Generate the conditional actions of this StnAction. More... | |
const std::vector< Predicate > & | effects () const |
Get the effects of the StnAction. More... | |
std::string | name () const |
Get the name of the StnAction. More... | |
size_t | duration () const |
Get the duration of the StnAction. More... | |
std::string | opts () const |
Get the action parameters. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &, const StnAction &) |
Print relevant information about the StnAction. More... | |
An action representation within an STN.
Definition at line 40 of file stn_action.h.
fawkes::stn::StnAction::StnAction | ( | const std::string & | name, |
const std::vector< Predicate > & | preconds, | ||
const std::vector< Predicate > & | effects, | ||
const std::string & | opts, | ||
size_t | duration = 0 , |
||
const std::vector< std::string > & | cond_breakups = {} , |
||
const std::vector< std::string > & | temp_breakups = {} |
||
) |
Constructor.
name | The name of the new action. |
preconds | A Vector of Predicates that must be satisfied to execute the action. |
effects | A vector of Predicates that are applied after the action is executed. |
opts | The action parameters. |
duration | The duration of the action. |
cond_breakups | A vector of conditional breakups as strings. |
temp_breakups | A vector of temporal breakups as strings. |
Definition at line 44 of file stn_action.cpp.
|
inline |
Definition at line 50 of file stn_action.h.
|
inlinevirtual |
Definition at line 51 of file stn_action.h.
bool fawkes::stn::StnAction::checkForBreakup | ( | EdgeType | t, |
const Predicate & | p | ||
) | const |
Check if the given predicate is a breakup.
t | The type of of breakup to check. |
p | The Predicate to check. |
Definition at line 150 of file stn_action.cpp.
References fawkes::stn::Predicate::name().
Referenced by genConditionalActions().
std::vector< size_t > fawkes::stn::StnAction::condActionIds | ( | ) | const |
Get all IDs of this StnAction's conditional actions.
Definition at line 135 of file stn_action.cpp.
size_t fawkes::stn::StnAction::duration | ( | ) | const |
Get the duration of the StnAction.
Definition at line 286 of file stn_action.cpp.
const std::vector< Predicate > & fawkes::stn::StnAction::effects | ( | ) | const |
Get the effects of the StnAction.
Definition at line 268 of file stn_action.cpp.
void fawkes::stn::StnAction::genConditionalActions | ( | std::vector< StnAction > | candidate_actions | ) |
Generate the conditional actions of this StnAction.
candidate_actions | The actions to be considered as conditional actions. |
Definition at line 224 of file stn_action.cpp.
References checkForBreakup().
std::string fawkes::stn::StnAction::genConditionEdgeLabel | ( | size_t | cond_action | ) | const |
Generate an edge label for the graph representation.
cond_action | The ID of the conditional action to represent. |
Definition at line 186 of file stn_action.cpp.
References fawkes::stn::Predicate::attrs(), fawkes::stn::Predicate::condition(), and fawkes::stn::Predicate::name().
std::string fawkes::stn::StnAction::genGraphNodeName | ( | ) | const |
Get a string representation of the StnAction for the graph representation.
Definition at line 176 of file stn_action.cpp.
std::string fawkes::stn::StnAction::genTemporalEdgeLabel | ( | ) | const |
Generate a temporal edge for the graph representation.
Definition at line 212 of file stn_action.cpp.
size_t fawkes::stn::StnAction::id | ( | ) | const |
std::string fawkes::stn::StnAction::name | ( | ) | const |
Get the name of the StnAction.
Definition at line 277 of file stn_action.cpp.
bool fawkes::stn::StnAction::operator!= | ( | const StnAction & | o | ) |
Compare two StnActions.
o | The other StnAction. |
Definition at line 117 of file stn_action.cpp.
bool fawkes::stn::StnAction::operator== | ( | const StnAction & | o | ) |
Compare two StnActions.
o | The other StnAction. |
Definition at line 107 of file stn_action.cpp.
std::string fawkes::stn::StnAction::opts | ( | ) | const |
Get the action parameters.
Definition at line 295 of file stn_action.cpp.
|
friend |
Print relevant information about the StnAction.
strm | The stream to print the information to. |
a | The action to show the information about. |
Definition at line 66 of file stn_action.cpp.