![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
<agrum/FMDP/simulation/fmdpSimulator.h> More...
#include <fmdpSimulator.h>
Public Member Functions | |
Constructors, Destructors. | |
| FMDPSimulator (const FMDP< double > *fmdp) | |
| Default constructor. | |
| FMDPSimulator (const std::string &resource) | |
| Default constructor. | |
| ~FMDPSimulator () | |
| Default destructor. | |
| double | reward () |
| Sets the intial statefrom which we begun the simulation. | |
| void | perform (Idx) |
| Sets the intial statefrom which we begun the simulation. | |
| const DiscreteVariable * | primeVar (const DiscreteVariable *mainVar) |
| Iteration over the variables of the simulated probleme. | |
| SequenceIteratorSafe< const DiscreteVariable * > | beginVariables () |
| Iteration over the variables of the simulated probleme. | |
| SequenceIteratorSafe< const DiscreteVariable * > | endVariables () |
| Iteration over the variables of the simulated probleme. | |
| virtual const std::string & | actionName (Idx actionId) |
| Iteration over the variables of the simulated probleme. | |
| SequenceIteratorSafe< Idx > | beginActions () |
| Iteration over the variables of the simulated probleme. | |
| SequenceIteratorSafe< Idx > | endActions () |
| Iteration over the variables of the simulated probleme. | |
Public Attributes | |
| Instantiation | currentState_ |
| Tha state in which the system currently is. | |
| Instantiation | endState_ |
Protected Member Functions | |
| virtual double | transitionProbability_ (const DiscreteVariable *var, const Instantiation &transit, Idx actionId) |
Private Attributes | |
| FMDP< double > * | _fmdp_ |
| The Factored Markov Decision Process that describes how the system evolves. | |
| const bool | _loaded_ |
| Just to know if it should be deleted in the end. | |
| INLINE void | setInitialState (const Instantiation &initialState) |
| Sets the intial statefrom which we begun the simulation. | |
| void | setInitialStateRandomly () |
| Sets the intial statefrom which we begun the simulation. | |
| INLINE void | setEndState (const Instantiation &endState) |
| Sets the final states upon which a run is over. | |
| virtual bool | hasReachEnd () |
| Tests if end state has been reached. | |
| INLINE const Instantiation & | currentState () |
| Sets the intial statefrom which we begun the simulation. | |
| virtual Instantiation | randomState_ () |
| Choses a random state as the first test for a run. | |
<agrum/FMDP/simulation/fmdpSimulator.h>
A class to simulate a Factored Markov Decision Process.
Definition at line 67 of file fmdpSimulator.h.
Default constructor.
Definition at line 69 of file fmdpSimulator.cpp.
References gum::AbstractSimulator::AbstractSimulator(), FMDPSimulator(), _fmdp_, and _loaded_.
Referenced by FMDPSimulator(), FMDPSimulator(), and ~FMDPSimulator().
| gum::FMDPSimulator::FMDPSimulator | ( | const std::string & | resource | ) |
Default constructor.
Definition at line 74 of file fmdpSimulator.cpp.
References gum::AbstractSimulator::AbstractSimulator(), FMDPSimulator(), _fmdp_, _loaded_, gum::FMDPDatReader< GUM_SCALAR >::proceed(), and gum::FMDPDatReader< GUM_SCALAR >::trace().
| gum::FMDPSimulator::~FMDPSimulator | ( | ) |
Default destructor.
Definition at line 86 of file fmdpSimulator.cpp.
References FMDPSimulator(), _fmdp_, and _loaded_.
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 124 of file fmdpSimulator.h.
References _fmdp_.
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 127 of file fmdpSimulator.h.
References _fmdp_.
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 109 of file fmdpSimulator.h.
References _fmdp_.
Referenced by perform().
|
inlineinherited |
Sets the intial statefrom which we begun the simulation.
Definition at line 108 of file abstractSimulator.h.
References currentState_.
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 129 of file fmdpSimulator.h.
References _fmdp_.
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 113 of file fmdpSimulator.h.
References _fmdp_.
Referenced by perform().
|
virtualinherited |
Tests if end state has been reached.
Reimplemented in gum::FactorySimulator, and gum::TaxiSimulator.
Definition at line 100 of file abstractSimulator.cpp.
References currentState_, and endState_.
Referenced by setInitialStateRandomly().
|
virtual |
Sets the intial statefrom which we begun the simulation.
Implements gum::AbstractSimulator.
Definition at line 95 of file fmdpSimulator.cpp.
References gum::Instantiation::add(), beginVariables(), gum::Instantiation::chgVal(), gum::AbstractSimulator::currentState_, gum::Instantiation::end(), endVariables(), gum::Instantiation::incOut(), primeVar(), gum::randomProba(), gum::Instantiation::setFirstOut(), transitionProbability_(), and gum::Instantiation::val().
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 104 of file fmdpSimulator.h.
References _fmdp_.
Referenced by perform().
|
protectedvirtualinherited |
Choses a random state as the first test for a run.
Reimplemented in gum::FactorySimulator, and gum::TaxiSimulator.
Definition at line 90 of file abstractSimulator.cpp.
References gum::Instantiation::add(), beginVariables(), gum::Instantiation::chgVal(), endVariables(), and gum::randomValue().
Referenced by gum::TaxiSimulator::randomState_(), and setInitialStateRandomly().
|
inlinevirtual |
Sets the intial statefrom which we begun the simulation.
Implements gum::AbstractSimulator.
Definition at line 93 of file fmdpSimulator.h.
References _fmdp_, and gum::AbstractSimulator::currentState_.
|
inlineinherited |
Sets the final states upon which a run is over.
Definition at line 102 of file abstractSimulator.h.
References endState_.
|
inlineinherited |
Sets the intial statefrom which we begun the simulation.
Definition at line 92 of file abstractSimulator.h.
References currentState_.
|
inherited |
Sets the intial statefrom which we begun the simulation.
Definition at line 82 of file abstractSimulator.cpp.
References currentState_, hasReachEnd(), and randomState_().
|
inlineprotectedvirtual |
Definition at line 134 of file fmdpSimulator.h.
References _fmdp_, and gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::get().
Referenced by perform().
The Factored Markov Decision Process that describes how the system evolves.
Definition at line 145 of file fmdpSimulator.h.
Referenced by FMDPSimulator(), FMDPSimulator(), ~FMDPSimulator(), actionName(), beginActions(), beginVariables(), endActions(), endVariables(), primeVar(), reward(), and transitionProbability_().
|
private |
Just to know if it should be deleted in the end.
Definition at line 148 of file fmdpSimulator.h.
Referenced by FMDPSimulator(), FMDPSimulator(), and ~FMDPSimulator().
|
inherited |
Tha state in which the system currently is.
Definition at line 146 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_(), currentState(), hasReachEnd(), gum::FMDPSimulator::perform(), gum::TaxiSimulator::perform(), gum::FMDPSimulator::reward(), setInitialState(), and setInitialStateRandomly().
|
inherited |
Definition at line 146 of file abstractSimulator.h.
Referenced by hasReachEnd(), and setEndState().