50#ifndef GUM_FMDP_FACTORY_H
51#define GUM_FMDP_FACTORY_H
86 template <
typename GUM_SCALAR >
167 void addAction(
const std::string& action);
292 std::vector< const MultiDimImplementation< GUM_SCALAR >* >
_ddBag_;
332#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
Headers of the IFMDPFactory interface-like class.
A factory class to ease Factored Markov Decision Process construction.
Base class for discrete random variable.
A factory class to ease Factored Markov Decision Process construction.
void addCost()
Tells the factory to add a cost table to the current fmdp. This cost table will be extracted from inc...
NodeId addTerminalNode(float value)
Insert in diagram a terminal node.
void setOperationModeOn(std::string operationType)
Tells the factory that we're in a reward declaration mode where the global reward diagram is an opera...
FMDP< GUM_SCALAR > * _fmdp_
The constructed FMDP.
void addArc(NodeId from, NodeId to, Idx modality)
Insert in diagram a non terminal node.
FMDPFactory(FMDP< GUM_SCALAR > *fmdp)
Use this constructor if you want to use an already created factored markov decision process.
FMDPFactory< GUM_SCALAR > & operator=(const FMDPFactory< GUM_SCALAR > &source)
Copy operator is illegal, use only copy constructor.
void endTransitionDeclaration()
Tells the factory that we're out of a transition declaration.
void addTransition(const std::string &var, const MultiDimAdressable *transition)
Tells the factory to add a transition table to the current fmdp.
void addAction(const std::string &action)
Tells the factory to add an action to the current fmdp.
void startVariableDeclaration()
Tells the factory that we're in a variable declaration.
void startDiscountDeclaration()
Tells the factory that we're in a cost declaration.
void _resetParts_()
Reset the different parts used to constructed the FMDP.
~FMDPFactory()
Destructor.
void _initializeFunctionGraph_()
Insert every variables in the function graph.
void variableName(const std::string &name)
Tells the factory the current variable's name.
HashTable< std::string, const DiscreteVariable * > _varNameMap_
Mapping between a declared variable's name and itself.
void addModality(const std::string &name)
Adds a modality to the current variable.
void addReward()
Tells the factory to add a reward table to the current fmdp. This reward table will be extracted from...
void startTransitionDeclaration()
Tells the factory that we're in a transition declaration.
void endVariableDeclaration()
Tells the factory that we're out of a variable declaration.
void startActionDeclaration()
Tells the factory that we're in an action declaration.
bool _bar_flag_
Depending on the context this flag is used for some VERY important reasons.
bool _foo_flag_
Depending on the context this flag is used for some VERY important reasons.
void _checkModalityInBag_(const std::string &mod)
Used in VARIABLE mode Checks if in stringBag there is no other modality with the same name.
void endCostDeclaration()
Tells the factory that we're out of a cost declaration.
void startRewardDeclaration()
Tells the factory that we're in a reward declaration.
void endRewardDeclaration()
Tells the factory that we're out of a cost declaration.
std::vector< const MultiDimImplementation< GUM_SCALAR > * > _ddBag_
Just to keep track of multidim between two start/end calls.
void startCostDeclaration()
Tells the factory that we're in a cost declaration.
void endActionDeclaration()
Tells the factory that we're out of an action declaration.
void endDiscountDeclaration()
Tells the factory that we're out of a cost declaration.
FMDPfactory_state state() const
Returns the current state of the factory.
FMDP< GUM_SCALAR > * fmdp() const
Returns the Factored Markov Decision Process created by this factory.
std::vector< FMDPfactory_state > _states_
State stack.
void variableDescription(const std::string &desc)
Tells the factory the current variable's description.
void setRoot(NodeId rootId)
add an arc in diagram
const DiscreteVariable * variable(const std::string &name) const
Returns a constant reference on a variable given it's name.
void addDiscount(float discount)
Tells the factory to add a cost table to the current fmdp.
NodeId addInternalNode(std::string name_of_var)
Insert in diagram a non terminal node.
MultiDimFunctionGraph< GUM_SCALAR > * _FunctionGraph_
The FunctionGraph we're building at a given time.
std::vector< std::string > _stringBag_
Just to keep track of strings between two start/end calls.
void _finalizeFunctionGraph_()
Insert every variables in the function graph.
void _illegalStateError_(const std::string &s)
Raise an OperationNotAllowed with the message "Illegal state.".
Idx _actionIdcpt_
Action Id counter.
This class is used to implement factored decision process.
The class for generic Hash Tables.
Abstract base class for all multi dimensionnal addressable.
Class implementingting a function graph.
Template Implementation of the FMDPFactory class.
Size Idx
Type for indexes.
Size NodeId
Type for node ids.
Base class for labelized discrete random variables.
gum is the global namespace for all aGrUM entities
FMDPfactory_state
The enumeration of states in which the factory can be in.