aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
gum::StatisticalLazyDecider Class Reference

<agrum/FMDP/decision/statisticalLazyDecider.h> More...

#include <statisticalLazyDecider.h>

Inheritance diagram for gum::StatisticalLazyDecider:
Collaboration diagram for gum::StatisticalLazyDecider:

Public Member Functions

Constructor & destructor.
 StatisticalLazyDecider ()
 Constructor.
 ~StatisticalLazyDecider ()
 Destructor.
Initialization
virtual void initialize (const FMDP< double > *fmdp)
 Initializes the learner.

Incremental methods

StatesCounter _counter_
bool _initialized_
void checkState (const Instantiation &newState, Idx actionId=0)

Incremental methods

void setOptimalStrategy (MultiDimFunctionGraph< ActionSet, SetTerminalNodePolicy > *optPol)
virtual ActionSet stateOptimalPolicy (const Instantiation &curState)
const MultiDimFunctionGraph< ActionSet, SetTerminalNodePolicy > * optPol_ {nullptr}
ActionSet allActions_

Detailed Description

<agrum/FMDP/decision/statisticalLazyDecider.h>

Class to make no decision at all yet performing statistic on visited states. Actions are randomly chosen among all actions available

Does nothing more for decison making But count how many times every visited states have been visited

Definition at line 74 of file statisticalLazyDecider.h.

Constructor & Destructor Documentation

◆ StatisticalLazyDecider()

gum::StatisticalLazyDecider::StatisticalLazyDecider ( )
inline

Constructor.

Definition at line 84 of file statisticalLazyDecider.h.

References StatisticalLazyDecider(), _counter_, and _initialized_.

Referenced by StatisticalLazyDecider(), and ~StatisticalLazyDecider().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~StatisticalLazyDecider()

gum::StatisticalLazyDecider::~StatisticalLazyDecider ( )
inline

Destructor.

Definition at line 91 of file statisticalLazyDecider.h.

91 {
92 GUM_DESTRUCTOR(StatisticalLazyDecider);
93 ;
94 }

References StatisticalLazyDecider().

Here is the call graph for this function:

Member Function Documentation

◆ checkState()

void gum::StatisticalLazyDecider::checkState ( const Instantiation & newState,
Idx actionId = 0 )
inlinevirtual

Implements gum::IDecisionStrategy.

Definition at line 105 of file statisticalLazyDecider.h.

105 {
106 if (!_initialized_) {
107 _counter_.reset(newState);
108 _initialized_ = true;
109 } else _counter_.incState(newState);
110 }

References _counter_, and _initialized_.

◆ initialize()

virtual void gum::IDecisionStrategy::initialize ( const FMDP< double > * fmdp)
inlinevirtualinherited

Initializes the learner.

Reimplemented in gum::AdaptiveRMaxPlaner, and gum::E_GreedyDecider.

Definition at line 93 of file IDecisionStrategy.h.

93 {
94 optPol_ = nullptr;
95 if (allActions_.size() == 0)
96 for (auto actionIter = fmdp->beginActions(); actionIter != fmdp->endActions(); ++actionIter)
97 allActions_ += *actionIter;
98 }
const MultiDimFunctionGraph< ActionSet, SetTerminalNodePolicy > * optPol_

References allActions_, gum::FMDP< GUM_SCALAR >::beginActions(), gum::FMDP< GUM_SCALAR >::endActions(), and optPol_.

Referenced by gum::AdaptiveRMaxPlaner::initialize(), and gum::E_GreedyDecider::initialize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setOptimalStrategy()

void gum::IDecisionStrategy::setOptimalStrategy ( MultiDimFunctionGraph< ActionSet, SetTerminalNodePolicy > * optPol)
inlineinherited

Definition at line 111 of file IDecisionStrategy.h.

111 {
112 optPol_ = optPol;
113 }

References optPol_.

◆ stateOptimalPolicy()

virtual ActionSet gum::IDecisionStrategy::stateOptimalPolicy ( const Instantiation & curState)
inlinevirtualinherited

Reimplemented in gum::E_GreedyDecider, and gum::RandomDecider.

Definition at line 115 of file IDecisionStrategy.h.

115 {
116 return (optPol_ && optPol_->realSize() != 0) ? optPol_->get(curState) : allActions_;
117 }

References allActions_, and optPol_.

Referenced by gum::E_GreedyDecider::stateOptimalPolicy().

Here is the caller graph for this function:

Member Data Documentation

◆ _counter_

StatesCounter gum::StatisticalLazyDecider::_counter_
private

Definition at line 113 of file statisticalLazyDecider.h.

Referenced by StatisticalLazyDecider(), and checkState().

◆ _initialized_

bool gum::StatisticalLazyDecider::_initialized_
private

Definition at line 114 of file statisticalLazyDecider.h.

Referenced by StatisticalLazyDecider(), and checkState().

◆ allActions_

ActionSet gum::IDecisionStrategy::allActions_
protectedinherited

◆ optPol_

const MultiDimFunctionGraph< ActionSet, SetTerminalNodePolicy >* gum::IDecisionStrategy::optPol_ {nullptr}
protectedinherited

Definition at line 121 of file IDecisionStrategy.h.

121{nullptr};

Referenced by initialize(), setOptimalStrategy(), and stateOptimalPolicy().


The documentation for this class was generated from the following file: