aGrUM  0.16.0
abstractSimulator.h
Go to the documentation of this file.
1 
29 #ifndef GUM_ABSTRACT_SIMULATOR_H
30 #define GUM_ABSTRACT_SIMULATOR_H
31 //======================================================================
33 //======================================================================
34 #include <agrum/FMDP/fmdp.h>
35 //======================================================================
36 //======================================================================
37 
38 namespace gum {
49  public:
50  // ===========================================================================
52  // ===========================================================================
54 
59 
63  virtual ~AbstractSimulator();
64 
66 
67  // ===========================================================================
69  // ===========================================================================
71 
73  INLINE void setInitialState(const Instantiation& initialState) {
74  _currentState = initialState;
75  }
77 
78  protected:
80  virtual Instantiation _randomState();
81 
82  public:
84  INLINE void setEndState(const Instantiation& endState) {
85  _endState = endState;
86  }
87 
89  virtual bool hasReachEnd();
90 
92  INLINE const Instantiation& currentState() { return _currentState; }
93 
95  virtual double reward() = 0;
96 
98  virtual void perform(Idx) = 0;
99 
101 
102  // ===========================================================================
104  // ===========================================================================
106 
107  virtual const DiscreteVariable* primeVar(const DiscreteVariable* mainVar) = 0;
108 
112 
114 
115  // ===========================================================================
117  // ===========================================================================
119 
120  virtual const std::string& actionName(Idx) = 0;
121 
125 
126 
128 
131  };
132 
133 } /* namespace gum */
134 
135 
136 #endif // GUM__ABSTRACT_SIMULATOR_H
virtual double reward()=0
Sets the intial statefrom which we begun the simulation.
Safe iterators for Sequence.
Definition: sequence.h:1206
virtual bool hasReachEnd()
Tests if end state has been reached.
<agrum/FMDP/simulation/abstractSimulator.h>
virtual SequenceIteratorSafe< Idx > endActions()=0
Iteration over the variables of the simulated probleme.
virtual void perform(Idx)=0
Sets the intial statefrom which we begun the simulation.
Base class for discrete random variable.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
INLINE const Instantiation & currentState()
Sets the intial statefrom which we begun the simulation.
Instantiation _currentState
Tha state in which the system currently is.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual ~AbstractSimulator()
Default destructor.
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 const DiscreteVariable * primeVar(const DiscreteVariable *mainVar)=0
Iteration over the variables of the simulated probleme.
virtual SequenceIteratorSafe< const DiscreteVariable *> beginVariables()=0
Iteration over the variables of the simulated probleme.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual Instantiation _randomState()
Choses a random state as the first test for a run.
virtual SequenceIteratorSafe< const DiscreteVariable *> endVariables()=0
Iteration over the variables of the simulated probleme.
Class for assigning/browsing values to tuples of discrete variables.
Definition: instantiation.h:83
Size Idx
Type for indexes.
Definition: types.h:53
virtual const std::string & actionName(Idx)=0
Iteration over the variables of the simulated probleme.
virtual SequenceIteratorSafe< Idx > beginActions()=0
Iteration over the variables of the simulated probleme.
INLINE void setInitialState(const Instantiation &initialState)
Sets the intial statefrom which we begun the simulation.
AbstractSimulator()
Default constructor.