50#ifndef GUM_FMDP_FACTORY_H
51#define GUM_FMDP_FACTORY_H
88 template <
typename GUM_ELEMENT >
169 void addAction(std::string_view action)
override;
294 std::vector< const MultiDimImplementation< GUM_ELEMENT >* >
_ddBag_;
334#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 variableName(std::string_view name) override
Tells the factory the current variable's name.
void addModality(std::string_view name) override
Adds a modality to the current variable.
void endVariableDeclaration() override
Tells the factory that we're out of a variable declaration.
NodeId addInternalNode(std::string_view name_of_var) override
Insert in diagram a non terminal node.
const DiscreteVariable * variable(std::string_view name) const override
Returns a constant reference on a variable given it's name.
void endTransitionDeclaration() override
Tells the factory that we're out of a transition declaration.
void endDiscountDeclaration() override
Tells the factory that we're out of a cost declaration.
~FMDPFactory() override
Destructor.
std::vector< FMDPfactory_state > _states_
State stack.
FMDPFactory< GUM_ELEMENT > & operator=(const FMDPFactory< GUM_ELEMENT > &source)
Copy operator is illegal, use only copy constructor.
void startActionDeclaration() override
Tells the factory that we're in an action declaration.
void addCost() override
Tells the factory to add a cost table to the current fmdp. This cost table will be extracted from inc...
void _resetParts_()
Reset the different parts used to constructed the FMDP.
HashTable< std::string, const DiscreteVariable * > _varNameMap_
Mapping between a declared variable's name and itself.
FMDP< GUM_ELEMENT > * _fmdp_
The constructed FMDP.
void addTransition(std::string_view var, const MultiDimAdressable *transition) override
Tells the factory to add a transition table to the current fmdp.
void _finalizeFunctionGraph_()
Insert every variables in the function graph.
void addArc(NodeId from, NodeId to, Idx modality) override
Insert in diagram a non terminal node.
void addReward() override
Tells the factory to add a reward table to the current fmdp. This reward table will be extracted from...
void endActionDeclaration() override
Tells the factory that we're out of an action declaration.
bool _foo_flag_
Depending on the context this flag is used for some VERY important reasons.
void _initializeFunctionGraph_()
Insert every variables in the function graph.
void setRoot(NodeId rootId) override
add an arc in diagram
void addDiscount(float discount) override
Tells the factory to add a cost table to the current fmdp.
MultiDimFunctionGraph< GUM_ELEMENT > * _FunctionGraph_
The FunctionGraph we're building at a given time.
void _checkModalityInBag_(std::string_view mod)
Used in VARIABLE mode Checks if in stringBag there is no other modality with the same name.
void endRewardDeclaration() override
Tells the factory that we're out of a cost declaration.
void startVariableDeclaration() override
Tells the factory that we're in a variable declaration.
FMDP< GUM_ELEMENT > * fmdp() const
Returns the Factored Markov Decision Process created by this factory.
void startDiscountDeclaration() override
Tells the factory that we're in a cost declaration.
void startCostDeclaration() override
Tells the factory that we're in a cost declaration.
FMDPFactory(FMDP< GUM_ELEMENT > *fmdp)
Use this constructor if you want to use an already created factored markov decision process.
FMDPfactory_state state() const override
Returns the current state of the factory.
NodeId addTerminalNode(float value) override
Insert in diagram a terminal node.
bool _bar_flag_
Depending on the context this flag is used for some VERY important reasons.
void endCostDeclaration() override
Tells the factory that we're out of a cost declaration.
std::vector< std::string > _stringBag_
Just to keep track of strings between two start/end calls.
Idx _actionIdcpt_
Action Id counter.
void variableDescription(std::string_view desc) override
Tells the factory the current variable's description.
std::vector< const MultiDimImplementation< GUM_ELEMENT > * > _ddBag_
Just to keep track of multidim between two start/end calls.
void startRewardDeclaration() override
Tells the factory that we're in a reward declaration.
void _illegalStateError_(std::string_view s)
Raise an OperationNotAllowed with the message "Illegal state.".
void startTransitionDeclaration() override
Tells the factory that we're in a transition declaration.
void addAction(std::string_view action) override
Tells the factory to add an action to the current fmdp.
void setOperationModeOn(std::string_view operationType) override
Tells the factory that we're in a reward declaration mode where the global reward diagram is an opera...
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.