43 template <
TESTNAME VariableAttributeSelection,
46 FMDPLearner< VariableAttributeSelection,
47 RewardAttributeSelection,
51 __actionReward(actionReward),
52 __learningThreshold(lT), __similarityThreshold(sT) {
61 template <
TESTNAME VariableAttributeSelection,
65 RewardAttributeSelection,
70 for (
auto learnerIter = actionIter.val()->beginSafe();
71 learnerIter != actionIter.val()->endSafe();
73 delete learnerIter.val();
74 delete actionIter.val();
92 template <
TESTNAME VariableAttributeSelection,
96 RewardAttributeSelection,
107 mainVariables.
insert(*varIter);
124 +
" - VARIABLE : " + (*varIter)->name());
153 template <
TESTNAME VariableAttributeSelection,
157 RewardAttributeSelection,
165 ->getWithDefault(*varIter,
nullptr)
166 ->addObservation(newObs);
167 __actionLearners[actionId]->getWithDefault(*varIter,
nullptr)->updateGraph();
187 template <
TESTNAME VariableAttributeSelection,
191 RewardAttributeSelection,
202 ->getWithDefault(*varIter,
nullptr)
216 template <
TESTNAME VariableAttributeSelection,
220 RewardAttributeSelection,
230 ->getWithDefault(*varIter,
nullptr)
231 ->updateFunctionGraph();
Safe iterators for Sequence.
MultiDimFunctionGraph< double > * __instantiateFunctionGraph()
Initializes the learner.
void initialize(FMDP< double > *fmdp)
Initializes the learner.
SequenceIteratorSafe< Idx > beginActions() const
Returns an iterator reference to he beginning of the list of actions.
void addReward(const MultiDimImplementation< GUM_SCALAR > *reward)
Adds a default variable reward.
const std::string & actionName(Idx actionId) const
Returns name of action given in parameter.
HashTable< Idx, VarLearnerTable *> __actionLearners
SequenceIteratorSafe< const DiscreteVariable *> beginVariables() const
Returns an iterator reference to he beginning of the list of variables.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
~FMDPLearner()
Default destructor.
bool addObservation(Idx actionId, const Observation *obs)
Gives to the learner a new transition.
FMDP< double > * __fmdp
The FMDP to store the learned model.
RewardLearnerType * __instantiateRewardLearner(MultiDimFunctionGraph< double > *target, Set< const DiscreteVariable * > &mainVariables)
Initializes the learner.
Representation of a setA Set is a structure that contains arbitrary elements.
HashTable< const DiscreteVariable *, VariableLearnerType *> VarLearnerTable
void addTransitionForAction(Idx actionId, const DiscreteVariable *var, const MultiDimImplementation< GUM_SCALAR > *transition)
Adds a variable transition table to specified action.
double reward() const
Returns the modality assumed by the given variable in this observation.
HashTable< Idx, RewardLearnerType *> __actionRewardLearners
void addRewardForAction(Idx actionId, const MultiDimImplementation< GUM_SCALAR > *reward)
Adds a default variable reward.
const DiscreteVariable * main2prime(const DiscreteVariable *mainVar) const
Returns the primed variable associate to the given main variable.
void updateFMDP()
Starts an update of datastructure in the associated FMDP.
SequenceIteratorSafe< Idx > endActions() const
Returns an iterator reference to the end of the list of actions.
VariableLearnerType * __instantiateVarLearner(MultiDimFunctionGraph< double > *target, Set< const DiscreteVariable * > &mainVariables, const DiscreteVariable *learnedVar)
Initializes the learner.
Size Idx
Type for indexes.
double __modaMax
learnerSize
SequenceIteratorSafe< const DiscreteVariable *> endVariables() const
Returns an iterator reference to the end of the list of variables.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
RewardLearnerType * __rewardLearner
void setTableName(const std::string &name)
Sets the name of the table represented by this structure.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void insert(const Key &k)
Inserts a new element into the set.