aGrUM  0.14.2
gum::LazyDecider Class Reference

Class to make decision randomlyDoes nothing more than the interface for DecisionStrategy does. More...

#include <agrum/FMDP/SDyna/lazyDecider.h>

+ Inheritance diagram for gum::LazyDecider:
+ Collaboration diagram for gum::LazyDecider:

Public Member Functions

Constructor & destructor.
 LazyDecider ()
 Constructor. More...
 
 ~LazyDecider ()
 Destructor. More...
 
Incremental methods
void checkState (const Instantiation &newState, Idx actionId)
 
Initialization
virtual void initialize (const FMDP< double > *fmdp)
 Initializes the learner. More...
 

Incremental methods

void setOptimalStrategy (const MultiDimFunctionGraph< ActionSet, SetTerminalNodePolicy > *optPol)
 
virtual ActionSet stateOptimalPolicy (const Instantiation &curState)
 
const MultiDimFunctionGraph< ActionSet, SetTerminalNodePolicy > * _optPol
 
ActionSet _allActions
 

Detailed Description

Class to make decision randomly

Does nothing more than the interface for DecisionStrategy does.

Definition at line 46 of file lazyDecider.h.

Constructor & Destructor Documentation

◆ LazyDecider()

gum::LazyDecider::LazyDecider ( )
inline

Constructor.

Definition at line 55 of file lazyDecider.h.

55 {}

◆ ~LazyDecider()

gum::LazyDecider::~LazyDecider ( )
inline

Destructor.

Definition at line 60 of file lazyDecider.h.

60 {}

Member Function Documentation

◆ checkState()

void gum::LazyDecider::checkState ( const Instantiation newState,
Idx  actionId 
)
inlinevirtual

Implements gum::IDecisionStrategy.

Definition at line 70 of file lazyDecider.h.

70 {}

◆ 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 69 of file IDecisionStrategy.h.

References gum::IDecisionStrategy::_allActions, gum::IDecisionStrategy::_optPol, gum::FMDP< GUM_SCALAR >::beginActions(), gum::IDecisionStrategy::checkState(), gum::FMDP< GUM_SCALAR >::endActions(), and gum::ActionSet::size().

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

69  {
70  _optPol = nullptr;
71  if (_allActions.size() == 0)
72  for (auto actionIter = fmdp->beginActions();
73  actionIter != fmdp->endActions();
74  ++actionIter)
75  _allActions += *actionIter;
76  }
Size size() const
Gives the size.
Definition: actionSet.h:208
SequenceIteratorSafe< Idx > beginActions() const
Returns an iterator reference to he beginning of the list of actions.
Definition: fmdp.h:134
const MultiDimFunctionGraph< ActionSet, SetTerminalNodePolicy > * _optPol
SequenceIteratorSafe< Idx > endActions() const
Returns an iterator reference to the end of the list of actions.
Definition: fmdp.h:141
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setOptimalStrategy()

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

Definition at line 87 of file IDecisionStrategy.h.

References gum::IDecisionStrategy::_optPol.

Referenced by gum::SDYNA::makePlanning().

88  {
89  _optPol =
90  const_cast< MultiDimFunctionGraph< ActionSet, SetTerminalNodePolicy >* >(
91  optPol);
92  }
const MultiDimFunctionGraph< ActionSet, SetTerminalNodePolicy > * _optPol
+ Here is the caller graph for this function:

◆ stateOptimalPolicy()

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

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

Definition at line 94 of file IDecisionStrategy.h.

References gum::IDecisionStrategy::_allActions, and gum::IDecisionStrategy::_optPol.

Referenced by gum::E_GreedyDecider::stateOptimalPolicy(), and gum::SDYNA::takeAction().

94  {
95  return (_optPol && _optPol->realSize() != 0) ? _optPol->get(curState)
96  : _allActions;
97  }
const MultiDimFunctionGraph< ActionSet, SetTerminalNodePolicy > * _optPol
+ Here is the caller graph for this function:

Member Data Documentation

◆ _allActions

◆ _optPol


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