![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
This class is used to implement factored decision process. More...
#include <fmdp.h>
Public Member Functions | |
Constructors, Destructors. | |
FMDP (bool onDestructionDeleteVar=false) | |
Default constructor. More... | |
~FMDP () | |
Default destructor. More... | |
Variable Handling Methods. | |
void | addVariable (const DiscreteVariable *var) |
Adds a variable to FMDP description. More... | |
SequenceIteratorSafe< const DiscreteVariable *> | beginVariables () const |
Returns an iterator reference to he beginning of the list of variables. More... | |
SequenceIteratorSafe< const DiscreteVariable *> | endVariables () const |
Returns an iterator reference to the end of the list of variables. More... | |
const DiscreteVariable * | main2prime (const DiscreteVariable *mainVar) const |
Returns the primed variable associate to the given main variable. More... | |
INLINE const Bijection< const DiscreteVariable *, const DiscreteVariable *> & | mapMainPrime () const |
Returns the map binding main variables and prime variables. More... | |
Action Handling Methods. | |
void | addAction (Idx actionId, const std::string &action) |
Adds an action to FMDP description. More... | |
SequenceIteratorSafe< Idx > | beginActions () const |
Returns an iterator reference to he beginning of the list of actions. More... | |
SequenceIteratorSafe< Idx > | endActions () const |
Returns an iterator reference to the end of the list of actions. More... | |
Transition methods. | |
void | addTransitionForAction (Idx actionId, const DiscreteVariable *var, const MultiDimImplementation< GUM_SCALAR > *transition) |
Adds a variable transition table to specified action. More... | |
void | addTransition (const DiscreteVariable *var, const MultiDimImplementation< GUM_SCALAR > *transition) |
Adds a default variable transition. More... | |
const MultiDimImplementation< GUM_SCALAR > * | transition (Idx actionId, const DiscreteVariable *v) const |
Returns transition associated to given in parameter variable and the given action. More... | |
Cost methods. | |
void | addCostForAction (Idx actionId, const MultiDimImplementation< GUM_SCALAR > *cost) |
Adds a cost table to specified action. More... | |
void | addCost (const MultiDimImplementation< GUM_SCALAR > *cost) |
Adds a default variable cost. More... | |
const MultiDimImplementation< GUM_SCALAR > * | cost (Idx actionId=0) const |
Returns the reward table of mdp. More... | |
Reward methods. | |
void | addRewardForAction (Idx actionId, const MultiDimImplementation< GUM_SCALAR > *reward) |
Adds a default variable reward. More... | |
void | addReward (const MultiDimImplementation< GUM_SCALAR > *reward) |
Adds a default variable reward. More... | |
const MultiDimImplementation< GUM_SCALAR > * | reward (Idx actionId=0) const |
Returns the reward table of mdp. More... | |
FMPD miscelleanous methods. | |
const std::string & | actionName (Idx actionId) const |
Returns name of action given in parameter. More... | |
Idx | actionId (const std::string &) const |
Returns action id. More... | |
std::string | toString () const |
Displays the FMDP in a Dot format. More... | |
Size | size () const |
Returns the map binding main variables and prime variables. More... | |
This class is used to implement factored decision process.
This class supports a mechanism which allows user to give, for each variable ivolved in the process, a default transition probability table and to describe for specific actions a different table.
|
private |
INLINE gum::FMDP< GUM_SCALAR >::FMDP | ( | bool | onDestructionDeleteVar = false | ) |
Default constructor.
Definition at line 53 of file fmdp_tpl.h.
Default destructor.
Definition at line 68 of file fmdp_tpl.h.
INLINE Idx gum::FMDP< GUM_SCALAR >::actionId | ( | const std::string & | action | ) | const |
Returns action id.
Definition at line 325 of file fmdp_tpl.h.
INLINE const std::string & gum::FMDP< GUM_SCALAR >::actionName | ( | Idx | actionId | ) | const |
Returns name of action given in parameter.
Definition at line 314 of file fmdp_tpl.h.
INLINE void gum::FMDP< GUM_SCALAR >::addAction | ( | Idx | actionId, |
const std::string & | action | ||
) |
Adds an action to FMDP description.
DuplicateElement | if an action with same name already exists |
Definition at line 144 of file fmdp_tpl.h.
Referenced by gum::FMDP< double >::mapMainPrime().
|
inline |
Adds a default variable cost.
DuplicateElement | if a default cost exists already |
Definition at line 194 of file fmdp.h.
INLINE void gum::FMDP< GUM_SCALAR >::addCostForAction | ( | Idx | actionId, |
const MultiDimImplementation< GUM_SCALAR > * | cost | ||
) |
Adds a cost table to specified action.
NotFound | if action does not exists |
Definition at line 234 of file fmdp_tpl.h.
|
inline |
Adds a default variable reward.
DuplicateElement | if a default reward exists already |
Definition at line 220 of file fmdp.h.
INLINE void gum::FMDP< GUM_SCALAR >::addRewardForAction | ( | Idx | actionId, |
const MultiDimImplementation< GUM_SCALAR > * | reward | ||
) |
Adds a default variable reward.
DuplicateElement | if a default reward exists already |
Definition at line 274 of file fmdp_tpl.h.
|
inline |
Adds a default variable transition.
NotFound | if var does not exists |
DuplicateElement | if variable already has a default transition |
Definition at line 165 of file fmdp.h.
INLINE void gum::FMDP< GUM_SCALAR >::addTransitionForAction | ( | Idx | actionId, |
const DiscreteVariable * | var, | ||
const MultiDimImplementation< GUM_SCALAR > * | transition | ||
) |
Adds a variable transition table to specified action.
NotFound | if action or var does not exists |
DuplicateElement | if variable already has a transition for this action |
Definition at line 183 of file fmdp_tpl.h.
INLINE void gum::FMDP< GUM_SCALAR >::addVariable | ( | const DiscreteVariable * | var | ) |
Adds a variable to FMDP description.
DuplicateElement | if a similar variable already exists |
Definition at line 116 of file fmdp_tpl.h.
|
inline |
Returns an iterator reference to he beginning of the list of actions.
Definition at line 136 of file fmdp.h.
|
inline |
Returns an iterator reference to he beginning of the list of variables.
Definition at line 94 of file fmdp.h.
INLINE const MultiDimImplementation< GUM_SCALAR > * gum::FMDP< GUM_SCALAR >::cost | ( | Idx | actionId = 0 | ) | const |
Returns the reward table of mdp.
Definition at line 251 of file fmdp_tpl.h.
|
inline |
Returns an iterator reference to the end of the list of actions.
Definition at line 141 of file fmdp.h.
|
inline |
Returns an iterator reference to the end of the list of variables.
Definition at line 101 of file fmdp.h.
|
inline |
Returns the primed variable associate to the given main variable.
Definition at line 108 of file fmdp.h.
|
inline |
Returns the map binding main variables and prime variables.
Definition at line 116 of file fmdp.h.
INLINE const MultiDimImplementation< GUM_SCALAR > * gum::FMDP< GUM_SCALAR >::reward | ( | Idx | actionId = 0 | ) | const |
Returns the reward table of mdp.
Definition at line 293 of file fmdp_tpl.h.
Returns the map binding main variables and prime variables.
Definition at line 356 of file fmdp_tpl.h.
INLINE std::string gum::FMDP< GUM_SCALAR >::toString | ( | ) | const |
Displays the FMDP in a Dot format.
Definition at line 336 of file fmdp_tpl.h.
INLINE const MultiDimImplementation< GUM_SCALAR > * gum::FMDP< GUM_SCALAR >::transition | ( | Idx | actionId, |
const DiscreteVariable * | v | ||
) | const |
Returns transition associated to given in parameter variable and the given action.
Definition at line 208 of file fmdp_tpl.h.
|
private |
|
private |
|
private |
|
private |
|
private |