aGrUM  0.16.0
gum::RandomDecider Class Reference

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

#include <agrum/FMDP/decision/randomDecider.h>

+ Inheritance diagram for gum::RandomDecider:
+ Collaboration diagram for gum::RandomDecider:

Public Member Functions

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

Incremental methods

void setOptimalStrategy (const MultiDimFunctionGraph< ActionSet, SetTerminalNodePolicy > *optPol)
 
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 49 of file randomDecider.h.

Constructor & Destructor Documentation

◆ RandomDecider()

gum::RandomDecider::RandomDecider ( )
inline

Constructor.

Definition at line 58 of file randomDecider.h.

58 {}

◆ ~RandomDecider()

gum::RandomDecider::~RandomDecider ( )
inline

Destructor.

Definition at line 63 of file randomDecider.h.

63 {}

Member Function Documentation

◆ checkState()

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

Implements gum::IDecisionStrategy.

Definition at line 73 of file randomDecider.h.

73 {}

◆ 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 72 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().

72  {
73  _optPol = nullptr;
74  if (_allActions.size() == 0)
75  for (auto actionIter = fmdp->beginActions();
76  actionIter != fmdp->endActions();
77  ++actionIter)
78  _allActions += *actionIter;
79  }
Size size() const
Gives the size.
Definition: actionSet.h:211
SequenceIteratorSafe< Idx > beginActions() const
Returns an iterator reference to he beginning of the list of actions.
Definition: fmdp.h:137
const MultiDimFunctionGraph< ActionSet, SetTerminalNodePolicy > * _optPol
SequenceIteratorSafe< Idx > endActions() const
Returns an iterator reference to the end of the list of actions.
Definition: fmdp.h:144
+ 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 90 of file IDecisionStrategy.h.

References gum::IDecisionStrategy::_optPol.

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

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

◆ stateOptimalPolicy()

ActionSet gum::RandomDecider::stateOptimalPolicy ( const Instantiation curState)
inlinevirtual

Reimplemented from gum::IDecisionStrategy.

Definition at line 75 of file randomDecider.h.

References gum::IDecisionStrategy::_allActions.

75  {
76  return _allActions;
77  }

Member Data Documentation

◆ _allActions

◆ _optPol


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