![]() |
aGrUM
0.16.0
|
A factory class to ease Factored Markov Decision Process construction. More...
#include <agrum/FMDP/fmdpFactory.h>
Public Member Functions | |
Constructor & destructor. | |
FMDPFactory (FMDP< GUM_SCALAR > *fmdp) | |
Use this constructor if you want to use an already created factored markov decision process. More... | |
~FMDPFactory () | |
Destructor. More... | |
Getter and setters. | |
FMDP< GUM_SCALAR > * | fmdp () const |
Returns the Factored Markov Decision Process created by this factory. More... | |
FMDPfactory_state | state () const |
Returns the current state of the factory. More... | |
const DiscreteVariable * | variable (const std::string &name) const |
Returns a constant reference on a variable given it's name. More... | |
Variable declaration methods (NONE -> VARIABLE) | |
void | startVariableDeclaration () |
Tells the factory that we're in a variable declaration. More... | |
void | variableName (const std::string &name) |
Tells the factory the current variable's name. More... | |
void | variableDescription (const std::string &desc) |
Tells the factory the current variable's description. More... | |
void | addModality (const std::string &name) |
Adds a modality to the current variable. More... | |
void | endVariableDeclaration () |
Tells the factory that we're out of a variable declaration. More... | |
Action declaration methods (NONE -> ACTION) | |
void | startActionDeclaration () |
Tells the factory that we're in an action declaration. More... | |
void | addAction (const std::string &action) |
Tells the factory to add an action to the current fmdp. More... | |
void | endActionDeclaration () |
Tells the factory that we're out of an action declaration. More... | |
Transition declaration methods (NONE -> TRANSITION <- ACTION) | |
void | startTransitionDeclaration () |
Tells the factory that we're in a transition declaration. More... | |
void | addTransition (const std::string &var, const MultiDimAdressable *transition) |
Tells the factory to add a transition table to the current fmdp. More... | |
void | addTransition (const std::string &var) |
Tells the factory to add a transition table to the current fmdp. This transition table will be extracted from incorporated multiDimFunctionGraph. More... | |
void | endTransitionDeclaration () |
Tells the factory that we're out of a transition declaration. More... | |
Cost declaration methods (NONE -> COST <- ACTION) | |
void | startCostDeclaration () |
Tells the factory that we're in a cost declaration. More... | |
void | addCost (const MultiDimAdressable *cost) |
Tells the factory to add a cost table to the current fmdp. More... | |
void | addCost () |
Tells the factory to add a cost table to the current fmdp. This cost table will be extracted from incorporated multiDimFunctionGraph. More... | |
void | endCostDeclaration () |
Tells the factory that we're out of a cost declaration. More... | |
Reward declaration methods (NONE -> REWARD <- ACTION) | |
void | startRewardDeclaration () |
Tells the factory that we're in a reward declaration. More... | |
void | setOperationModeOn (std::string operationType) |
Tells the factory that we're in a reward declaration mode where the global reward diagram is an operation between simplier decision diagram.. More... | |
void | addReward (const MultiDimAdressable *reward) |
Tells the factory to add a reward table to the current fmdp. More... | |
void | addReward () |
Tells the factory to add a reward table to the current fmdp. This reward table will be extracted from incorporated multiDimFunctionGraph. More... | |
void | endRewardDeclaration () |
Tells the factory that we're out of a cost declaration. More... | |
Discount declaration methods (NONE -> DISCOUNT) | |
void | startDiscountDeclaration () |
Tells the factory that we're in a cost declaration. More... | |
void | addDiscount (float discount) |
Tells the factory to add a cost table to the current fmdp. More... | |
void | endDiscountDeclaration () |
Tells the factory that we're out of a cost declaration. More... | |
FunctionGraph Creation specific methods | |
methods used by internal FunctionGraphfactory to build up a multidimFunctionGraph | |
NodeId | addInternalNode (std::string name_of_var) |
Insert in diagram a non terminal node. More... | |
NodeId | addTerminalNode (float value) |
Insert in diagram a terminal node. More... | |
void | addArc (NodeId from, NodeId to, Idx modality) |
Insert in diagram a non terminal node. More... | |
void | setRoot (NodeId rootId) |
add an arc in diagram More... | |
verbosity control | |
void | setVerbose () |
void | resetVerbose () |
bool | isVerbose () |
Current constructed FMDP's parts. | |
bool | __foo_flag |
Depending on the context this flag is used for some VERY important reasons. More... | |
bool | __bar_flag |
Depending on the context this flag is used for some VERY important reasons. More... | |
std::vector< std::string > | __stringBag |
Just to keep track of strings between two start/end calls. More... | |
std::vector< const MultiDimImplementation< GUM_SCALAR > *> | __ddBag |
Just to keep track of multidim between two start/end calls. More... | |
void | __checkModalityInBag (const std::string &mod) |
Used in VARIABLE mode Checks if in __stringBag there is no other modality with the same name. More... | |
void | __resetParts () |
Reset the different parts used to constructed the FMDP. More... | |
void | __initializeFunctionGraph () |
Insert every variables in the function graph. More... | |
void | __finalizeFunctionGraph () |
Insert every variables in the function graph. More... | |
A factory class to ease Factored Markov Decision Process construction.
A FMDPFactory will never create a Factored Markov Decision Process and works on only one Factored Markov Decision Process.
The only exception of this behaviour is when you create a copy of the factory, it will create a copy of its FMDP. This is useful when you want to create two FMDP sharing a common base. However be very careful because the copy will not delete its FMDP.
Each method will raise an OperationNotAllowed if you call it when the factory is not in a valid state for that call. The error message is "Illegal state.".
Definition at line 71 of file fmdpFactory.h.
INLINE gum::FMDPFactory< GUM_SCALAR >::FMDPFactory | ( | FMDP< GUM_SCALAR > * | fmdp | ) |
Use this constructor if you want to use an already created factored markov decision process.
fmdp | A pointer over the FMDP filled by this factory. |
Definition at line 57 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__actionIdcpt, gum::FMDPFactory< GUM_SCALAR >::__states, gum::NONE, and gum::AbstractFMDPFactory::resetVerbose().
INLINE gum::FMDPFactory< GUM_SCALAR >::~FMDPFactory | ( | ) |
Destructor.
To prevent strange behaviour you should always destroy a FMDPFactory when it's state equals NONE.
FatalError | Raised if the state of the factory prevents it to die peacefully. |
Definition at line 70 of file fmdpFactory_tpl.h.
|
private |
Used in VARIABLE mode Checks if in __stringBag there is no other modality with the same name.
Definition at line 199 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__stringBag, and GUM_ERROR.
Referenced by gum::FMDPFactory< GUM_SCALAR >::addModality().
|
private |
Insert every variables in the function graph.
Definition at line 739 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__FunctionGraph, gum::MultiDimFunctionGraphManager< GUM_SCALAR, TerminalNodePolicy >::clean(), gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::manager(), gum::FMDPFactory< GUM_SCALAR >::operator=(), and gum::MultiDimFunctionGraphManager< GUM_SCALAR, TerminalNodePolicy >::reduce().
Referenced by gum::FMDPFactory< GUM_SCALAR >::addCost(), gum::FMDPFactory< GUM_SCALAR >::addReward(), and gum::FMDPFactory< GUM_SCALAR >::addTransition().
|
private |
Raise an OperationNotAllowed with the message "Illegal state.".
Definition at line 674 of file fmdpFactory_tpl.h.
References gum::ACTION, gum::COST, gum::DISCOUNT, GUM_ERROR, gum::NONE, gum::REWARD, gum::FMDPFactory< GUM_SCALAR >::state(), gum::TRANSITION, and gum::VARIABLE.
Referenced by gum::FMDPFactory< GUM_SCALAR >::addAction(), gum::FMDPFactory< GUM_SCALAR >::addCost(), gum::FMDPFactory< GUM_SCALAR >::addDiscount(), gum::FMDPFactory< GUM_SCALAR >::addModality(), gum::FMDPFactory< GUM_SCALAR >::addReward(), gum::FMDPFactory< GUM_SCALAR >::addTransition(), gum::FMDPFactory< GUM_SCALAR >::endActionDeclaration(), gum::FMDPFactory< GUM_SCALAR >::endCostDeclaration(), gum::FMDPFactory< GUM_SCALAR >::endDiscountDeclaration(), gum::FMDPFactory< GUM_SCALAR >::endRewardDeclaration(), gum::FMDPFactory< GUM_SCALAR >::endTransitionDeclaration(), gum::FMDPFactory< GUM_SCALAR >::endVariableDeclaration(), gum::FMDPFactory< GUM_SCALAR >::startActionDeclaration(), gum::FMDPFactory< GUM_SCALAR >::startCostDeclaration(), gum::FMDPFactory< GUM_SCALAR >::startDiscountDeclaration(), gum::FMDPFactory< GUM_SCALAR >::startRewardDeclaration(), gum::FMDPFactory< GUM_SCALAR >::startTransitionDeclaration(), gum::FMDPFactory< GUM_SCALAR >::startVariableDeclaration(), gum::FMDPFactory< GUM_SCALAR >::variableDescription(), and gum::FMDPFactory< GUM_SCALAR >::variableName().
|
private |
Insert every variables in the function graph.
Definition at line 719 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__fmdp, gum::FMDPFactory< GUM_SCALAR >::__FunctionGraph, gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::add(), and gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::getReducedAndOrderedInstance().
Referenced by gum::FMDPFactory< GUM_SCALAR >::startCostDeclaration(), gum::FMDPFactory< GUM_SCALAR >::startRewardDeclaration(), and gum::FMDPFactory< GUM_SCALAR >::startTransitionDeclaration().
|
private |
Reset the different parts used to constructed the FMDP.
Definition at line 710 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__bar_flag, gum::FMDPFactory< GUM_SCALAR >::__ddBag, gum::FMDPFactory< GUM_SCALAR >::__foo_flag, and gum::FMDPFactory< GUM_SCALAR >::__stringBag.
Referenced by gum::FMDPFactory< GUM_SCALAR >::endActionDeclaration(), gum::FMDPFactory< GUM_SCALAR >::endRewardDeclaration(), and gum::FMDPFactory< GUM_SCALAR >::endVariableDeclaration().
|
virtual |
Tells the factory to add an action to the current fmdp.
Implements gum::AbstractFMDPFactory.
Definition at line 282 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__actionIdcpt, gum::FMDPFactory< GUM_SCALAR >::__fmdp, gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::__stringBag, gum::ACTION, and gum::FMDPFactory< GUM_SCALAR >::state().
|
virtual |
Insert in diagram a non terminal node.
Implements gum::AbstractFMDPFactory.
Definition at line 651 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__FunctionGraph, gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::manager(), and gum::MultiDimFunctionGraphManager< GUM_SCALAR, TerminalNodePolicy >::setSon().
|
virtual |
Tells the factory to add a cost table to the current fmdp.
Implements gum::AbstractFMDPFactory.
Definition at line 415 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__fmdp, gum::FMDPFactory< GUM_SCALAR >::__foo_flag, gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::__stringBag, gum::COST, and gum::FMDPFactory< GUM_SCALAR >::state().
|
virtual |
Tells the factory to add a cost table to the current fmdp. This cost table will be extracted from incorporated multiDimFunctionGraph.
Implements gum::AbstractFMDPFactory.
Definition at line 432 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__finalizeFunctionGraph(), gum::FMDPFactory< GUM_SCALAR >::__fmdp, gum::FMDPFactory< GUM_SCALAR >::__foo_flag, gum::FMDPFactory< GUM_SCALAR >::__FunctionGraph, gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::__stringBag, gum::COST, and gum::FMDPFactory< GUM_SCALAR >::state().
|
virtual |
Tells the factory to add a cost table to the current fmdp.
Implements gum::AbstractFMDPFactory.
Definition at line 600 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::DISCOUNT, and gum::FMDPFactory< GUM_SCALAR >::state().
|
virtual |
Insert in diagram a non terminal node.
Implements gum::AbstractFMDPFactory.
Definition at line 635 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__FunctionGraph, gum::MultiDimFunctionGraphManager< GUM_SCALAR, TerminalNodePolicy >::addInternalNode(), gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::manager(), and gum::FMDPFactory< GUM_SCALAR >::variable().
|
virtual |
Adds a modality to the current variable.
Implements gum::AbstractFMDPFactory.
Definition at line 185 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__checkModalityInBag(), gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::__stringBag, gum::FMDPFactory< GUM_SCALAR >::state(), and gum::VARIABLE.
|
virtual |
Tells the factory to add a reward table to the current fmdp.
Implements gum::AbstractFMDPFactory.
Definition at line 501 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__fmdp, gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::REWARD, and gum::FMDPFactory< GUM_SCALAR >::state().
|
virtual |
Tells the factory to add a reward table to the current fmdp. This reward table will be extracted from incorporated multiDimFunctionGraph.
Implements gum::AbstractFMDPFactory.
Definition at line 517 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__ddBag, gum::FMDPFactory< GUM_SCALAR >::__finalizeFunctionGraph(), gum::FMDPFactory< GUM_SCALAR >::__fmdp, gum::FMDPFactory< GUM_SCALAR >::__foo_flag, gum::FMDPFactory< GUM_SCALAR >::__FunctionGraph, gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::REWARD, gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::setTableName(), and gum::FMDPFactory< GUM_SCALAR >::state().
|
virtual |
Insert in diagram a terminal node.
Implements gum::AbstractFMDPFactory.
Definition at line 643 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__FunctionGraph, gum::MultiDimFunctionGraphManager< GUM_SCALAR, TerminalNodePolicy >::addTerminalNode(), and gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::manager().
|
virtual |
Tells the factory to add a transition table to the current fmdp.
Implements gum::AbstractFMDPFactory.
Definition at line 335 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__fmdp, gum::FMDPFactory< GUM_SCALAR >::__foo_flag, gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::__stringBag, gum::FMDPFactory< GUM_SCALAR >::__varNameMap, gum::FMDPFactory< GUM_SCALAR >::state(), and gum::TRANSITION.
|
virtual |
Tells the factory to add a transition table to the current fmdp. This transition table will be extracted from incorporated multiDimFunctionGraph.
Implements gum::AbstractFMDPFactory.
Definition at line 355 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__finalizeFunctionGraph(), gum::FMDPFactory< GUM_SCALAR >::__fmdp, gum::FMDPFactory< GUM_SCALAR >::__foo_flag, gum::FMDPFactory< GUM_SCALAR >::__FunctionGraph, gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::__stringBag, gum::FMDPFactory< GUM_SCALAR >::__varNameMap, gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::setTableName(), gum::FMDPFactory< GUM_SCALAR >::state(), and gum::TRANSITION.
|
virtual |
Tells the factory that we're out of an action declaration.
Implements gum::AbstractFMDPFactory.
Definition at line 295 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::__resetParts(), gum::FMDPFactory< GUM_SCALAR >::__states, gum::ACTION, and gum::FMDPFactory< GUM_SCALAR >::state().
|
virtual |
Tells the factory that we're out of a cost declaration.
Implements gum::AbstractFMDPFactory.
Definition at line 450 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::__states, gum::COST, and gum::FMDPFactory< GUM_SCALAR >::state().
|
virtual |
Tells the factory that we're out of a cost declaration.
Implements gum::AbstractFMDPFactory.
Definition at line 610 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::__states, gum::DISCOUNT, and gum::FMDPFactory< GUM_SCALAR >::state().
|
virtual |
Tells the factory that we're out of a cost declaration.
Implements gum::AbstractFMDPFactory.
Definition at line 535 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__ddBag, gum::FMDPFactory< GUM_SCALAR >::__fmdp, gum::FMDPFactory< GUM_SCALAR >::__foo_flag, gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::__resetParts(), gum::FMDPFactory< GUM_SCALAR >::__states, gum::FMDPFactory< GUM_SCALAR >::__stringBag, gum::add2MultiDimFunctionGraphs(), gum::divide2MultiDimFunctionGraphs(), gum::multiply2MultiDimFunctionGraphs(), gum::REWARD, gum::FMDPFactory< GUM_SCALAR >::state(), and gum::subtract2MultiDimFunctionGraphs().
|
virtual |
Tells the factory that we're out of a transition declaration.
Implements gum::AbstractFMDPFactory.
Definition at line 377 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::__states, gum::FMDPFactory< GUM_SCALAR >::state(), and gum::TRANSITION.
|
virtual |
Tells the factory that we're out of a variable declaration.
UndefinedElement | Raised if the variable isn't defined (or not enough defined). |
Implements gum::AbstractFMDPFactory.
Definition at line 209 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__bar_flag, gum::FMDPFactory< GUM_SCALAR >::__fmdp, gum::FMDPFactory< GUM_SCALAR >::__foo_flag, gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::__resetParts(), gum::FMDPFactory< GUM_SCALAR >::__states, gum::FMDPFactory< GUM_SCALAR >::__stringBag, gum::FMDPFactory< GUM_SCALAR >::__varNameMap, gum::LabelizedVariable::addLabel(), GUM_ERROR, gum::Variable::name(), gum::FMDPFactory< GUM_SCALAR >::state(), and gum::VARIABLE.
INLINE FMDP< GUM_SCALAR > * gum::FMDPFactory< GUM_SCALAR >::fmdp | ( | ) | const |
Returns the Factored Markov Decision Process created by this factory.
OperationNotAllowed | Raise if the state of the factory is different than NONE. |
Definition at line 87 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__fmdp, GUM_ERROR, gum::NONE, and gum::FMDPFactory< GUM_SCALAR >::state().
|
inlineinherited |
Definition at line 276 of file IfmdpFactory.h.
|
private |
Copy operator is illegal, use only copy constructor.
Definition at line 761 of file fmdpFactory_tpl.h.
References GUM_ERROR.
Referenced by gum::FMDPFactory< GUM_SCALAR >::__finalizeFunctionGraph().
|
inlineinherited |
Definition at line 274 of file IfmdpFactory.h.
Referenced by gum::FMDPFactory< GUM_SCALAR >::FMDPFactory().
|
virtual |
Tells the factory that we're in a reward declaration mode where the global reward diagram is an operation between simplier decision diagram..
Implements gum::AbstractFMDPFactory.
Definition at line 490 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__foo_flag, and gum::FMDPFactory< GUM_SCALAR >::__stringBag.
|
virtual |
add an arc in diagram
Implements gum::AbstractFMDPFactory.
Definition at line 657 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__FunctionGraph, gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::manager(), and gum::MultiDimFunctionGraphManager< GUM_SCALAR, TerminalNodePolicy >::setRootNode().
|
inlineinherited |
Definition at line 272 of file IfmdpFactory.h.
|
virtual |
Tells the factory that we're in an action declaration.
Implements gum::AbstractFMDPFactory.
Definition at line 267 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__foo_flag, gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::__states, gum::ACTION, gum::NONE, and gum::FMDPFactory< GUM_SCALAR >::state().
|
virtual |
Tells the factory that we're in a cost declaration.
Implements gum::AbstractFMDPFactory.
Definition at line 401 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::__initializeFunctionGraph(), gum::FMDPFactory< GUM_SCALAR >::__states, gum::ACTION, gum::COST, gum::NONE, and gum::FMDPFactory< GUM_SCALAR >::state().
|
virtual |
Tells the factory that we're in a cost declaration.
Implements gum::AbstractFMDPFactory.
Definition at line 587 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::__states, gum::DISCOUNT, gum::NONE, and gum::FMDPFactory< GUM_SCALAR >::state().
|
virtual |
Tells the factory that we're in a reward declaration.
Implements gum::AbstractFMDPFactory.
Definition at line 474 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::__initializeFunctionGraph(), gum::FMDPFactory< GUM_SCALAR >::__states, gum::ACTION, gum::NONE, gum::REWARD, and gum::FMDPFactory< GUM_SCALAR >::state().
|
virtual |
Tells the factory that we're in a transition declaration.
Implements gum::AbstractFMDPFactory.
Definition at line 321 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::__initializeFunctionGraph(), gum::FMDPFactory< GUM_SCALAR >::__states, gum::ACTION, gum::NONE, gum::FMDPFactory< GUM_SCALAR >::state(), and gum::TRANSITION.
|
virtual |
Tells the factory that we're in a variable declaration.
Implements gum::AbstractFMDPFactory.
Definition at line 136 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::__states, gum::FMDPFactory< GUM_SCALAR >::__stringBag, gum::NONE, gum::FMDPFactory< GUM_SCALAR >::state(), and gum::VARIABLE.
|
virtual |
Returns the current state of the factory.
Implements gum::AbstractFMDPFactory.
Definition at line 101 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__states.
Referenced by gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::addAction(), gum::FMDPFactory< GUM_SCALAR >::addCost(), gum::FMDPFactory< GUM_SCALAR >::addDiscount(), gum::FMDPFactory< GUM_SCALAR >::addModality(), gum::FMDPFactory< GUM_SCALAR >::addReward(), gum::FMDPFactory< GUM_SCALAR >::addTransition(), gum::FMDPFactory< GUM_SCALAR >::endActionDeclaration(), gum::FMDPFactory< GUM_SCALAR >::endCostDeclaration(), gum::FMDPFactory< GUM_SCALAR >::endDiscountDeclaration(), gum::FMDPFactory< GUM_SCALAR >::endRewardDeclaration(), gum::FMDPFactory< GUM_SCALAR >::endTransitionDeclaration(), gum::FMDPFactory< GUM_SCALAR >::endVariableDeclaration(), gum::FMDPFactory< GUM_SCALAR >::fmdp(), gum::FMDPFactory< GUM_SCALAR >::startActionDeclaration(), gum::FMDPFactory< GUM_SCALAR >::startCostDeclaration(), gum::FMDPFactory< GUM_SCALAR >::startDiscountDeclaration(), gum::FMDPFactory< GUM_SCALAR >::startRewardDeclaration(), gum::FMDPFactory< GUM_SCALAR >::startTransitionDeclaration(), gum::FMDPFactory< GUM_SCALAR >::startVariableDeclaration(), gum::FMDPFactory< GUM_SCALAR >::variableDescription(), and gum::FMDPFactory< GUM_SCALAR >::variableName().
|
virtual |
Returns a constant reference on a variable given it's name.
NotFound | Raised if no variable matches the name. |
Implements gum::AbstractFMDPFactory.
Definition at line 113 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__varNameMap, and GUM_ERROR.
Referenced by gum::FMDPFactory< GUM_SCALAR >::addInternalNode().
|
virtual |
Tells the factory the current variable's description.
Implements gum::AbstractFMDPFactory.
Definition at line 170 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__bar_flag, gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::__stringBag, gum::FMDPFactory< GUM_SCALAR >::state(), and gum::VARIABLE.
|
virtual |
Tells the factory the current variable's name.
DuplicateElement | Raised if a variable with the same name already exist. |
Implements gum::AbstractFMDPFactory.
Definition at line 152 of file fmdpFactory_tpl.h.
References gum::FMDPFactory< GUM_SCALAR >::__foo_flag, gum::FMDPFactory< GUM_SCALAR >::__illegalStateError(), gum::FMDPFactory< GUM_SCALAR >::__stringBag, gum::FMDPFactory< GUM_SCALAR >::__varNameMap, GUM_ERROR, gum::FMDPFactory< GUM_SCALAR >::state(), and gum::VARIABLE.
|
private |
Action Id counter.
Definition at line 307 of file fmdpFactory.h.
Referenced by gum::FMDPFactory< GUM_SCALAR >::addAction(), and gum::FMDPFactory< GUM_SCALAR >::FMDPFactory().
|
private |
Depending on the context this flag is used for some VERY important reasons.
Definition at line 271 of file fmdpFactory.h.
Referenced by gum::FMDPFactory< GUM_SCALAR >::__resetParts(), gum::FMDPFactory< GUM_SCALAR >::endVariableDeclaration(), and gum::FMDPFactory< GUM_SCALAR >::variableDescription().
|
private |
Just to keep track of multidim between two start/end calls.
Definition at line 277 of file fmdpFactory.h.
Referenced by gum::FMDPFactory< GUM_SCALAR >::__resetParts(), gum::FMDPFactory< GUM_SCALAR >::addReward(), and gum::FMDPFactory< GUM_SCALAR >::endRewardDeclaration().
|
private |
The constructed FMDP.
Definition at line 298 of file fmdpFactory.h.
Referenced by gum::FMDPFactory< GUM_SCALAR >::__initializeFunctionGraph(), gum::FMDPFactory< GUM_SCALAR >::addAction(), gum::FMDPFactory< GUM_SCALAR >::addCost(), gum::FMDPFactory< GUM_SCALAR >::addReward(), gum::FMDPFactory< GUM_SCALAR >::addTransition(), gum::FMDPFactory< GUM_SCALAR >::endRewardDeclaration(), gum::FMDPFactory< GUM_SCALAR >::endVariableDeclaration(), and gum::FMDPFactory< GUM_SCALAR >::fmdp().
|
private |
Depending on the context this flag is used for some VERY important reasons.
Definition at line 267 of file fmdpFactory.h.
Referenced by gum::FMDPFactory< GUM_SCALAR >::__resetParts(), gum::FMDPFactory< GUM_SCALAR >::addCost(), gum::FMDPFactory< GUM_SCALAR >::addReward(), gum::FMDPFactory< GUM_SCALAR >::addTransition(), gum::FMDPFactory< GUM_SCALAR >::endRewardDeclaration(), gum::FMDPFactory< GUM_SCALAR >::endVariableDeclaration(), gum::FMDPFactory< GUM_SCALAR >::setOperationModeOn(), gum::FMDPFactory< GUM_SCALAR >::startActionDeclaration(), and gum::FMDPFactory< GUM_SCALAR >::variableName().
|
private |
The FunctionGraph we're building at a given time.
Definition at line 301 of file fmdpFactory.h.
Referenced by gum::FMDPFactory< GUM_SCALAR >::__finalizeFunctionGraph(), gum::FMDPFactory< GUM_SCALAR >::__initializeFunctionGraph(), gum::FMDPFactory< GUM_SCALAR >::addArc(), gum::FMDPFactory< GUM_SCALAR >::addCost(), gum::FMDPFactory< GUM_SCALAR >::addInternalNode(), gum::FMDPFactory< GUM_SCALAR >::addReward(), gum::FMDPFactory< GUM_SCALAR >::addTerminalNode(), gum::FMDPFactory< GUM_SCALAR >::addTransition(), and gum::FMDPFactory< GUM_SCALAR >::setRoot().
|
private |
State stack.
Definition at line 295 of file fmdpFactory.h.
Referenced by gum::FMDPFactory< GUM_SCALAR >::endActionDeclaration(), gum::FMDPFactory< GUM_SCALAR >::endCostDeclaration(), gum::FMDPFactory< GUM_SCALAR >::endDiscountDeclaration(), gum::FMDPFactory< GUM_SCALAR >::endRewardDeclaration(), gum::FMDPFactory< GUM_SCALAR >::endTransitionDeclaration(), gum::FMDPFactory< GUM_SCALAR >::endVariableDeclaration(), gum::FMDPFactory< GUM_SCALAR >::FMDPFactory(), gum::FMDPFactory< GUM_SCALAR >::startActionDeclaration(), gum::FMDPFactory< GUM_SCALAR >::startCostDeclaration(), gum::FMDPFactory< GUM_SCALAR >::startDiscountDeclaration(), gum::FMDPFactory< GUM_SCALAR >::startRewardDeclaration(), gum::FMDPFactory< GUM_SCALAR >::startTransitionDeclaration(), gum::FMDPFactory< GUM_SCALAR >::startVariableDeclaration(), and gum::FMDPFactory< GUM_SCALAR >::state().
|
private |
Just to keep track of strings between two start/end calls.
Definition at line 274 of file fmdpFactory.h.
Referenced by gum::FMDPFactory< GUM_SCALAR >::__checkModalityInBag(), gum::FMDPFactory< GUM_SCALAR >::__resetParts(), gum::FMDPFactory< GUM_SCALAR >::addAction(), gum::FMDPFactory< GUM_SCALAR >::addCost(), gum::FMDPFactory< GUM_SCALAR >::addModality(), gum::FMDPFactory< GUM_SCALAR >::addTransition(), gum::FMDPFactory< GUM_SCALAR >::endRewardDeclaration(), gum::FMDPFactory< GUM_SCALAR >::endVariableDeclaration(), gum::FMDPFactory< GUM_SCALAR >::setOperationModeOn(), gum::FMDPFactory< GUM_SCALAR >::startVariableDeclaration(), gum::FMDPFactory< GUM_SCALAR >::variableDescription(), and gum::FMDPFactory< GUM_SCALAR >::variableName().
|
private |
Mapping between a declared variable's name and itself.
Definition at line 304 of file fmdpFactory.h.
Referenced by gum::FMDPFactory< GUM_SCALAR >::addTransition(), gum::FMDPFactory< GUM_SCALAR >::endVariableDeclaration(), gum::FMDPFactory< GUM_SCALAR >::variable(), and gum::FMDPFactory< GUM_SCALAR >::variableName().