40 template <
TESTNAME VariableAttributeSelection,
43 FMDPLearner< VariableAttributeSelection,
44 RewardAttributeSelection,
48 __actionReward(actionReward),
49 __learningThreshold(lT), __similarityThreshold(sT) {
58 template <
TESTNAME VariableAttributeSelection,
62 RewardAttributeSelection,
67 for (
auto learnerIter = actionIter.val()->beginSafe();
68 learnerIter != actionIter.val()->endSafe();
70 delete learnerIter.val();
71 delete actionIter.val();
89 template <
TESTNAME VariableAttributeSelection,
93 RewardAttributeSelection,
104 mainVariables.
insert(*varIter);
121 +
" - VARIABLE : " + (*varIter)->name());
150 template <
TESTNAME VariableAttributeSelection,
154 RewardAttributeSelection,
162 ->getWithDefault(*varIter,
nullptr)
163 ->addObservation(newObs);
164 __actionLearners[actionId]->getWithDefault(*varIter,
nullptr)->updateGraph();
184 template <
TESTNAME VariableAttributeSelection,
188 RewardAttributeSelection,
199 ->getWithDefault(*varIter,
nullptr)
213 template <
TESTNAME VariableAttributeSelection,
217 RewardAttributeSelection,
227 ->getWithDefault(*varIter,
nullptr)
228 ->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.
gum is the global namespace for all aGrUM entities
~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.
Headers of the FMDPLearner class.
void insert(const Key &k)
Inserts a new element into the set.