![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
A factory class to ease Factored Markov Decision Process construction. More...
#include <agrum/FMDP/IfmdpFactory.h>
Public Member Functions | |
Constructor & destructor. | |
virtual | ~AbstractFMDPFactory () |
Destructor. More... | |
Getter and setters. | |
virtual FMDPfactory_state | state () const =0 |
Returns the current state of the factory. More... | |
virtual const DiscreteVariable * | variable (const std::string &name) const =0 |
Returns a constant reference on a variable given it's name. More... | |
Variable declaration methods (NONE -> VARIABLE) | |
virtual void | startVariableDeclaration ()=0 |
Tells the factory that we're in a variable declaration. More... | |
virtual void | variableName (const std::string &name)=0 |
Tells the factory the current variable's name. More... | |
virtual void | variableDescription (const std::string &desc)=0 |
Tells the factory the current variable's description. More... | |
virtual void | addModality (const std::string &name)=0 |
Adds a modality to the current variable. More... | |
virtual void | endVariableDeclaration ()=0 |
Tells the factory that we're out of a variable declaration. More... | |
Action declaration methods (NONE -> ACTION) | |
virtual void | startActionDeclaration ()=0 |
Tells the factory that we're in an action declaration. More... | |
virtual void | addAction (const std::string &action)=0 |
Tells the factory to add an action to the current fmdp. More... | |
virtual void | endActionDeclaration ()=0 |
Tells the factory that we're out of an action declaration. More... | |
Transition declaration methods (NONE -> TRANSITION <- ACTION) | |
virtual void | startTransitionDeclaration ()=0 |
Tells the factory that we're in a transition declaration. More... | |
virtual void | addTransition (const std::string &var, const MultiDimAdressable *transition)=0 |
Tells the factory to add a transition table to the current fmdp. More... | |
virtual void | addTransition (const std::string &var)=0 |
Tells the factory to add a transition table to the current fmdp. This transition table will be extracted from incorporated multiDimFunctionGraph. More... | |
virtual void | endTransitionDeclaration ()=0 |
Tells the factory that we're out of a transition declaration. More... | |
Cost declaration methods (NONE -> COST <- ACTION) | |
virtual void | startCostDeclaration ()=0 |
Tells the factory that we're in a cost declaration. More... | |
virtual void | addCost (const MultiDimAdressable *cost)=0 |
Tells the factory to add a cost table to the current fmdp. More... | |
virtual void | addCost ()=0 |
Tells the factory to add current decision diagram it has as a cost table. More... | |
virtual void | endCostDeclaration ()=0 |
Tells the factory that we're out of a cost declaration. More... | |
Reward declaration methods (NONE -> REWARD <- ACTION) | |
virtual void | startRewardDeclaration ()=0 |
Tells the factory that we're in a cost declaration. More... | |
virtual void | setOperationModeOn (std::string operationType)=0 |
Tells the factory that we're in a reward declaration mode where the global reward diagram is an operation between simplier decision diagram.. More... | |
virtual void | addReward (const MultiDimAdressable *reward)=0 |
Tells the factory to add a reward table to the current fmdp. More... | |
virtual void | addReward ()=0 |
Tells the factory to add current decision diagram it has as a reward table. More... | |
virtual void | endRewardDeclaration ()=0 |
Tells the factory that we're out of a cost declaration. More... | |
Discount declaration methods (NONE -> DISCOUNT) | |
virtual void | startDiscountDeclaration ()=0 |
Tells the factory that we're in a cost declaration. More... | |
virtual void | addDiscount (float discount)=0 |
Tells the factory to add a cost table to the current fmdp. More... | |
virtual void | endDiscountDeclaration ()=0 |
Tells the factory that we're out of a cost declaration. More... | |
FunctionGraph Creation specific methods | |
virtual NodeId | addInternalNode (std::string name_of_var)=0 |
Insert in diagram a non terminal node. More... | |
virtual NodeId | addTerminalNode (float value)=0 |
Insert in diagram a terminal node. More... | |
virtual void | addArc (NodeId from, NodeId to, Idx modality)=0 |
Insert in diagram an arc. More... | |
virtual void | setRoot (NodeId rootId)=0 |
Set the root of the diagram. More... | |
verbosity control | |
void | setVerbose () |
void | resetVerbose () |
bool | isVerbose () |
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 87 of file IfmdpFactory.h.
|
inlinevirtual |
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 115 of file IfmdpFactory.h.
|
pure virtual |
Tells the factory to add an action to the current fmdp.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
Insert in diagram an arc.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Tells the factory to add a cost table to the current fmdp.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Tells the factory to add current decision diagram it has as a cost table.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Tells the factory to add a cost table to the current fmdp.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Insert in diagram a non terminal node.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Adds a modality to the current variable.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Tells the factory to add a reward table to the current fmdp.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Tells the factory to add current decision diagram it has as a reward table.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Insert in diagram a terminal node.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Tells the factory to add a transition table to the current fmdp.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Tells the factory to add a transition table to the current fmdp. This transition table will be extracted from incorporated multiDimFunctionGraph.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Tells the factory that we're out of an action declaration.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Tells the factory that we're out of a cost declaration.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Tells the factory that we're out of a cost declaration.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Tells the factory that we're out of a cost declaration.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Tells the factory that we're out of a transition declaration.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Tells the factory that we're out of a variable declaration.
UndefinedElement | Raised if the variable isn't defined (or not enough defined). |
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
inline |
|
inline |
|
pure virtual |
Tells the factory that we're in a reward declaration mode where the global reward diagram is an operation between simplier decision diagram..
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Set the root of the diagram.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
inline |
|
pure virtual |
Tells the factory that we're in an action declaration.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Tells the factory that we're in a cost declaration.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Tells the factory that we're in a cost declaration.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Tells the factory that we're in a cost declaration.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Tells the factory that we're in a transition declaration.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Tells the factory that we're in a variable declaration.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Returns the current state of the factory.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Returns a constant reference on a variable given it's name.
NotFound | Raised if no variable matches the name. |
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Tells the factory the current variable's description.
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
pure virtual |
Tells the factory the current variable's name.
DuplicateElement | Raised if a variable with the same name already exist. |
Implemented in gum::FMDPFactory< GUM_SCALAR >.
|
private |
Definition at line 280 of file IfmdpFactory.h.
Referenced by isVerbose(), resetVerbose(), and setVerbose().