31 #ifndef GUM_ADAPTIVE_RMAX_PLANER_H 32 #define GUM_ADAPTIVE_RMAX_PLANER_H 34 #include <agrum/FMDP/SDyna/Strategies/IDecisionStrategy.h> 35 #include <agrum/FMDP/fmdp.h> 36 #include <agrum/FMDP/learning/fmdpLearner.h> 37 #include <agrum/FMDP/planning/structuredPlaner.h> 38 #include <agrum/FMDP/simulation/statesCounter.h> 66 double discountFactor = 0.9,
67 double epsilon = 0.00001,
68 bool verbose =
true) {
69 return new AdaptiveRMaxPlaner(
new MDDOperatorStrategy<
double >(),
80 double discountFactor = 0.9,
81 double epsilon = 0.00001,
82 bool verbose =
true) {
83 return new AdaptiveRMaxPlaner(
new TreeOperatorStrategy<
double >(),
101 double discountFactor,
103 const ILearningStrategy* learner,
201 void checkState(
const Instantiation& newState, Idx actionId) {
202 if (!initializedTable__[actionId]) {
203 counterTable__[actionId]->reset(newState);
204 initializedTable__[actionId] =
true;
206 counterTable__[actionId]->incState(newState);
void makePlanning(Idx nbStep=1000000)
Performs a value iteration.
~AdaptiveRMaxPlaner()
Default destructor.
INLINE void emplace(Args &&... args)
static AdaptiveRMaxPlaner * ReducedAndOrderedInstance(const ILearningStrategy *learner, double discountFactor=0.9, double epsilon=0.00001, bool verbose=true)
virtual void initVFunction_()
Performs a single step of value iteration.
AdaptiveRMaxPlaner(IOperatorStrategy< double > *opi, double discountFactor, double epsilon, const ILearningStrategy *learner, bool verbose)
Default constructor.
std::pair< NodeId, NodeId > visitLearner__(const IVisitableGraphLearner *, NodeId currentNodeId, MultiDimFunctionGraph< double > *, MultiDimFunctionGraph< double > *)
const ILearningStrategy * fmdpLearner__
HashTable< Idx, MultiDimFunctionGraph< double > *> actionsBoolTable__
static AdaptiveRMaxPlaner * TreeInstance(const ILearningStrategy *learner, double discountFactor=0.9, double epsilon=0.00001, bool verbose=true)
virtual MultiDimFunctionGraph< double > * valueIteration_()
Performs a single step of value iteration.
virtual void evalPolicy_()
Perform the required tasks to extract an optimal policy.
HashTable< Idx, StatesCounter *> counterTable__
HashTable< Idx, bool > initializedTable__
void initialize(const FMDP< double > *fmdp)
Initializes data structure needed for making the planning.
void makeRMaxFunctionGraphs__()
void checkState(const Instantiation &newState, Idx actionId)