![]() |
aGrUM
0.16.0
|
<agrum/FMDP/simulation/fmdpSimulator.h> More...
#include <fmdpSimulator.h>
Public Attributes | |
Instantiation | _currentState |
Tha state in which the system currently is. More... | |
Instantiation | _endState |
Public Member Functions | |
Constructors, Destructors. | |
FMDPSimulator (const FMDP< double > *fmdp) | |
Default constructor. More... | |
FMDPSimulator (const std::string &resource) | |
Default constructor. More... | |
~FMDPSimulator () | |
Default destructor. More... | |
double | reward () |
Sets the intial statefrom which we begun the simulation. More... | |
void | perform (Idx) |
Sets the intial statefrom which we begun the simulation. More... | |
const DiscreteVariable * | primeVar (const DiscreteVariable *mainVar) |
Iteration over the variables of the simulated probleme. More... | |
SequenceIteratorSafe< const DiscreteVariable *> | beginVariables () |
Iteration over the variables of the simulated probleme. More... | |
SequenceIteratorSafe< const DiscreteVariable *> | endVariables () |
Iteration over the variables of the simulated probleme. More... | |
virtual const std::string & | actionName (Idx actionId) |
Iteration over the variables of the simulated probleme. More... | |
SequenceIteratorSafe< Idx > | beginActions () |
Iteration over the variables of the simulated probleme. More... | |
SequenceIteratorSafe< Idx > | endActions () |
Iteration over the variables of the simulated probleme. More... | |
Protected Member Functions | |
virtual double | _transitionProbability (const DiscreteVariable *var, const Instantiation &transit, Idx actionId) |
INLINE void | setInitialState (const Instantiation &initialState) |
Sets the intial statefrom which we begun the simulation. More... | |
void | setInitialStateRandomly () |
Sets the intial statefrom which we begun the simulation. More... | |
INLINE void | setEndState (const Instantiation &endState) |
Sets the final states upon which a run is over. More... | |
virtual bool | hasReachEnd () |
Tests if end state has been reached. More... | |
INLINE const Instantiation & | currentState () |
Sets the intial statefrom which we begun the simulation. More... | |
virtual Instantiation | _randomState () |
Choses a random state as the first test for a run. More... | |
<agrum/FMDP/simulation/fmdpSimulator.h>
A class to simulate a Factored Markov Decision Process.
Definition at line 48 of file fmdpSimulator.h.
Default constructor.
Definition at line 47 of file fmdpSimulator.cpp.
gum::FMDPSimulator::FMDPSimulator | ( | const std::string & | resource | ) |
Default constructor.
Definition at line 53 of file fmdpSimulator.cpp.
References __fmdp.
gum::FMDPSimulator::~FMDPSimulator | ( | ) |
Default destructor.
Definition at line 66 of file fmdpSimulator.cpp.
References __fmdp, and __loaded.
|
protectedvirtualinherited |
Choses a random state as the first test for a run.
Reimplemented in gum::FactorySimulator, and gum::TaxiSimulator.
Definition at line 66 of file abstractSimulator.cpp.
References gum::Instantiation::add(), gum::AbstractSimulator::beginVariables(), gum::Instantiation::chgVal(), and gum::AbstractSimulator::endVariables().
Referenced by gum::TaxiSimulator::_randomState(), gum::AbstractSimulator::setInitialState(), and gum::AbstractSimulator::setInitialStateRandomly().
|
inlineprotectedvirtual |
Definition at line 114 of file fmdpSimulator.h.
References __fmdp, and gum::FMDP< GUM_SCALAR >::transition().
Referenced by perform().
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 104 of file fmdpSimulator.h.
References __fmdp, and gum::FMDP< GUM_SCALAR >::actionName().
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 109 of file fmdpSimulator.h.
References __fmdp, and gum::FMDP< GUM_SCALAR >::beginActions().
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 90 of file fmdpSimulator.h.
References __fmdp, and gum::FMDP< GUM_SCALAR >::beginVariables().
Referenced by perform().
|
inlineinherited |
Sets the intial statefrom which we begun the simulation.
Definition at line 92 of file abstractSimulator.h.
References gum::AbstractSimulator::_currentState, gum::AbstractSimulator::actionName(), gum::AbstractSimulator::beginActions(), gum::AbstractSimulator::beginVariables(), gum::AbstractSimulator::endActions(), gum::AbstractSimulator::endVariables(), gum::AbstractSimulator::perform(), gum::AbstractSimulator::primeVar(), and gum::AbstractSimulator::reward().
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 110 of file fmdpSimulator.h.
References __fmdp, and gum::FMDP< GUM_SCALAR >::endActions().
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 93 of file fmdpSimulator.h.
References __fmdp, and gum::FMDP< GUM_SCALAR >::endVariables().
Referenced by perform().
|
virtualinherited |
Tests if end state has been reached.
Reimplemented in gum::FactorySimulator, and gum::TaxiSimulator.
Definition at line 79 of file abstractSimulator.cpp.
References gum::AbstractSimulator::_currentState, gum::AbstractSimulator::_endState, gum::Instantiation::empty(), gum::Instantiation::val(), and gum::Instantiation::variablesSequence().
Referenced by gum::AbstractSimulator::setEndState(), and gum::AbstractSimulator::setInitialStateRandomly().
|
virtual |
Sets the intial statefrom which we begun the simulation.
Implements gum::AbstractSimulator.
Definition at line 76 of file fmdpSimulator.cpp.
References gum::AbstractSimulator::_currentState, _transitionProbability(), gum::Instantiation::add(), beginVariables(), gum::Instantiation::chgVal(), gum::Instantiation::end(), endVariables(), gum::Instantiation::incOut(), primeVar(), gum::Instantiation::setFirstOut(), and gum::Instantiation::val().
Referenced by reward().
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 85 of file fmdpSimulator.h.
References __fmdp, and gum::FMDP< GUM_SCALAR >::main2prime().
Referenced by perform().
|
inlinevirtual |
Sets the intial statefrom which we begun the simulation.
Implements gum::AbstractSimulator.
Definition at line 74 of file fmdpSimulator.h.
References __fmdp, gum::AbstractSimulator::_currentState, perform(), and gum::FMDP< GUM_SCALAR >::reward().
|
inlineinherited |
Sets the final states upon which a run is over.
Definition at line 84 of file abstractSimulator.h.
References gum::AbstractSimulator::_endState, and gum::AbstractSimulator::hasReachEnd().
|
inlineinherited |
Sets the intial statefrom which we begun the simulation.
Definition at line 73 of file abstractSimulator.h.
References gum::AbstractSimulator::_currentState, gum::AbstractSimulator::_randomState(), and gum::AbstractSimulator::setInitialStateRandomly().
|
inherited |
Sets the intial statefrom which we begun the simulation.
Definition at line 58 of file abstractSimulator.cpp.
References gum::AbstractSimulator::_currentState, gum::AbstractSimulator::_randomState(), and gum::AbstractSimulator::hasReachEnd().
Referenced by gum::AbstractSimulator::setInitialState().
The Factored Markov Decision Process that describes how the system evolves.
Definition at line 125 of file fmdpSimulator.h.
Referenced by _transitionProbability(), actionName(), beginActions(), beginVariables(), endActions(), endVariables(), FMDPSimulator(), primeVar(), reward(), and ~FMDPSimulator().
|
private |
Just to know if it should be deleted in the end.
Definition at line 128 of file fmdpSimulator.h.
Referenced by ~FMDPSimulator().
|
inherited |
Tha state in which the system currently is.
Definition at line 130 of file abstractSimulator.h.
Referenced by gum::TaxiSimulator::__evalReward(), gum::TaxiSimulator::__performFillUp(), gum::TaxiSimulator::__performGoEast(), gum::TaxiSimulator::__performGoNorth(), gum::TaxiSimulator::__performGoSouth(), gum::TaxiSimulator::__performGoWest(), gum::TaxiSimulator::__performPickUp(), gum::TaxiSimulator::__performPutDown(), gum::AbstractSimulator::currentState(), gum::AbstractSimulator::hasReachEnd(), perform(), gum::TaxiSimulator::perform(), reward(), gum::AbstractSimulator::setInitialState(), and gum::AbstractSimulator::setInitialStateRandomly().
|
inherited |
Definition at line 130 of file abstractSimulator.h.
Referenced by gum::AbstractSimulator::hasReachEnd(), and gum::AbstractSimulator::setEndState().