aGrUM 3.0.0
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 () override
 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) override

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 decision making But count how many times every visited states have been visited

Definition at line 74 of file statisticalLazyDecider.h.

Constructor & Destructor Documentation

◆ StatisticalLazyDecider()

INLINE gum::StatisticalLazyDecider::StatisticalLazyDecider ( )

Constructor.

Definition at line 48 of file statisticalLazyDecider_inl.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()

INLINE gum::StatisticalLazyDecider::~StatisticalLazyDecider ( )
override

Destructor.

Definition at line 52 of file statisticalLazyDecider_inl.h.

52 {
53 GUM_DESTRUCTOR(StatisticalLazyDecider);
54 ;
55 }

References StatisticalLazyDecider().

Here is the call graph for this function:

Member Function Documentation

◆ checkState()

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

Implements gum::IDecisionStrategy.

Definition at line 57 of file statisticalLazyDecider_inl.h.

57 {
58 if (!_initialized_) {
59 _counter_.reset(newState);
60 _initialized_ = true;
61 } else _counter_.incState(newState);
62 }

References _counter_, and _initialized_.

◆ initialize()

INLINE void gum::IDecisionStrategy::initialize ( const FMDP< double > * fmdp)
virtualinherited

Initializes the learner.

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

Definition at line 48 of file IDecisionStrategy_inl.h.

48 {
49 optPol_ = nullptr;
50 if (allActions_.size() == 0)
51 for (auto actionIter = fmdp->beginActions(); actionIter != fmdp->endActions(); ++actionIter)
52 allActions_ += *actionIter;
53 }
const MultiDimFunctionGraph< ActionSet, SetTerminalNodePolicy > * optPol_

References allActions_, gum::FMDP< GUM_ELEMENT >::beginActions(), gum::FMDP< GUM_ELEMENT >::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()

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

Definition at line 55 of file IDecisionStrategy_inl.h.

56 {
57 optPol_ = optPol;
58 }

References optPol_.

◆ stateOptimalPolicy()

INLINE ActionSet gum::IDecisionStrategy::stateOptimalPolicy ( const Instantiation & curState)
virtualinherited

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

Definition at line 60 of file IDecisionStrategy_inl.h.

60 {
61 return (optPol_ && optPol_->realSize() != 0) ? optPol_->get(curState) : allActions_;
62 }

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 103 of file statisticalLazyDecider.h.

Referenced by StatisticalLazyDecider(), and checkState().

◆ _initialized_

bool gum::StatisticalLazyDecider::_initialized_
private

Definition at line 104 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 112 of file IDecisionStrategy.h.

112{nullptr};

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


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