![]() |
aGrUM
0.16.0
|
<agrum/FMDP/simulation/abstractSimulator.h> More...
#include <abstractSimulator.h>
Public Attributes | |
Instantiation | _currentState |
Tha state in which the system currently is. More... | |
Instantiation | _endState |
Public Member Functions | |
Constructors, Destructors. | |
AbstractSimulator () | |
Default constructor. More... | |
virtual | ~AbstractSimulator () |
Default destructor. More... | |
Variables | |
virtual const DiscreteVariable * | primeVar (const DiscreteVariable *mainVar)=0 |
Iteration over the variables of the simulated probleme. More... | |
virtual SequenceIteratorSafe< const DiscreteVariable *> | beginVariables ()=0 |
Iteration over the variables of the simulated probleme. More... | |
virtual SequenceIteratorSafe< const DiscreteVariable *> | endVariables ()=0 |
Iteration over the variables of the simulated probleme. More... | |
Actions | |
virtual const std::string & | actionName (Idx)=0 |
Iteration over the variables of the simulated probleme. More... | |
virtual SequenceIteratorSafe< Idx > | beginActions ()=0 |
Iteration over the variables of the simulated probleme. More... | |
virtual SequenceIteratorSafe< Idx > | endActions ()=0 |
Iteration over the variables of the simulated probleme. More... | |
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 double | reward ()=0 |
Sets the intial statefrom which we begun the simulation. More... | |
virtual void | perform (Idx)=0 |
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/abstractSimulator.h>
A class to simulate a reinforcement learning problem.
Definition at line 48 of file abstractSimulator.h.
gum::AbstractSimulator::AbstractSimulator | ( | ) |
Default constructor.
Definition at line 46 of file abstractSimulator.cpp.
|
virtual |
Default destructor.
Definition at line 51 of file abstractSimulator.cpp.
|
protectedvirtual |
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(), beginVariables(), gum::Instantiation::chgVal(), and endVariables().
Referenced by gum::TaxiSimulator::_randomState(), setInitialState(), and setInitialStateRandomly().
|
pure virtual |
Iteration over the variables of the simulated probleme.
Implemented in gum::FactorySimulator, gum::TaxiSimulator, and gum::FMDPSimulator.
Referenced by currentState().
|
pure virtual |
Iteration over the variables of the simulated probleme.
Implemented in gum::FactorySimulator, gum::TaxiSimulator, and gum::FMDPSimulator.
Referenced by currentState().
|
pure virtual |
Iteration over the variables of the simulated probleme.
Implemented in gum::FactorySimulator, gum::TaxiSimulator, and gum::FMDPSimulator.
Referenced by _randomState(), and currentState().
|
inline |
Sets the intial statefrom which we begun the simulation.
Definition at line 92 of file abstractSimulator.h.
References _currentState, actionName(), beginActions(), beginVariables(), endActions(), endVariables(), perform(), primeVar(), and reward().
|
pure virtual |
Iteration over the variables of the simulated probleme.
Implemented in gum::FactorySimulator, gum::TaxiSimulator, and gum::FMDPSimulator.
Referenced by currentState().
|
pure virtual |
Iteration over the variables of the simulated probleme.
Implemented in gum::FactorySimulator, gum::TaxiSimulator, and gum::FMDPSimulator.
Referenced by _randomState(), and currentState().
|
virtual |
Tests if end state has been reached.
Reimplemented in gum::FactorySimulator, and gum::TaxiSimulator.
Definition at line 79 of file abstractSimulator.cpp.
References _currentState, _endState, gum::Instantiation::empty(), gum::Instantiation::val(), and gum::Instantiation::variablesSequence().
Referenced by setEndState(), and setInitialStateRandomly().
|
pure virtual |
Sets the intial statefrom which we begun the simulation.
Implemented in gum::TaxiSimulator, gum::FactorySimulator, and gum::FMDPSimulator.
Referenced by currentState().
|
pure virtual |
Iteration over the variables of the simulated probleme.
Implemented in gum::FactorySimulator, gum::TaxiSimulator, and gum::FMDPSimulator.
Referenced by currentState().
|
pure virtual |
Sets the intial statefrom which we begun the simulation.
Implemented in gum::TaxiSimulator, gum::FactorySimulator, and gum::FMDPSimulator.
Referenced by currentState().
|
inline |
Sets the final states upon which a run is over.
Definition at line 84 of file abstractSimulator.h.
References _endState, and hasReachEnd().
|
inline |
Sets the intial statefrom which we begun the simulation.
Definition at line 73 of file abstractSimulator.h.
References _currentState, _randomState(), and setInitialStateRandomly().
void gum::AbstractSimulator::setInitialStateRandomly | ( | ) |
Sets the intial statefrom which we begun the simulation.
Definition at line 58 of file abstractSimulator.cpp.
References _currentState, _randomState(), and hasReachEnd().
Referenced by setInitialState().
Instantiation gum::AbstractSimulator::_currentState |
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(), currentState(), hasReachEnd(), gum::FMDPSimulator::perform(), gum::TaxiSimulator::perform(), gum::FMDPSimulator::reward(), setInitialState(), and setInitialStateRandomly().
Instantiation gum::AbstractSimulator::_endState |
Definition at line 130 of file abstractSimulator.h.
Referenced by hasReachEnd(), and setEndState().