![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
A class to simulate the Taxi problem. More...
#include <agrum/FMDP/simulation/taxiSimulator.h>
Public Member Functions | |
Constructors, Destructors. | |
| TaxiSimulator () | |
| Default constructor. | |
| ~TaxiSimulator () | |
| Default destructor. | |
Variables | |
| 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. | |
| 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. | |
| INLINE const Instantiation & | currentState () |
| Sets the intial statefrom which we begun the simulation. | |
Public Attributes | |
| Instantiation | currentState_ |
| Tha state in which the system currently is. | |
| Instantiation | endState_ |
Private Attributes | |
| Sequence< const DiscreteVariable * > | _taxiVars_ |
| Variables data structures. | |
| Bijection< const DiscreteVariable *, const DiscreteVariable * > | _primeMap_ |
| LabelizedVariable * | _xPos_ |
| LabelizedVariable * | _yPos_ |
| LabelizedVariable * | _passengerPos_ |
| LabelizedVariable * | _passengerDest_ |
| LabelizedVariable * | _fuelLevel_ |
| Sequence< Idx > | _taxiActions_ |
| Actions. | |
| HashTable< Idx, std::string * > | _actionMap_ |
| TaxiSimulationAction | _lastAction_ |
| double | _reward_ |
| Reward. | |
States | |
| bool | hasReachEnd () |
| Choses a random state as the first test for a run. | |
| Instantiation | randomState_ () |
| Choses a random state as the first test for a run. | |
Actions | |
| 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. | |
| void | perform (Idx) |
| Iteration over the variables of the simulated probleme. | |
| void | _performGoNorth_ () |
| Iteration over the variables of the simulated probleme. | |
| void | _performGoEast_ () |
| Iteration over the variables of the simulated probleme. | |
| void | _performGoSouth_ () |
| Iteration over the variables of the simulated probleme. | |
| void | _performGoWest_ () |
| Iteration over the variables of the simulated probleme. | |
| void | _performPickUp_ () |
| Iteration over the variables of the simulated probleme. | |
| void | _performPutDown_ () |
| Iteration over the variables of the simulated probleme. | |
| void | _performFillUp_ () |
| Iteration over the variables of the simulated probleme. | |
Rewards | |
| double | reward () |
| Sets the intial statefrom which we begun the simulation. | |
| void | _evalReward_ () |
| bool | _isAtDestination_ (TaxiSimulationLandmark passDest, TaxiSimulationLandmarkX xCurPos, TaxiSimulationLandmarkY yCurPos) |
| bool | _isAtMeetPoint_ (TaxiSimulationLandmark passpos, TaxiSimulationLandmarkX xCurPos, TaxiSimulationLandmarkY yCurPos) |
A class to simulate the Taxi problem.
Definition at line 100 of file taxiSimulator.h.
| gum::TaxiSimulator::TaxiSimulator | ( | ) |
Default constructor.
Definition at line 57 of file taxiSimulator.cpp.
References gum::AbstractSimulator::AbstractSimulator(), TaxiSimulator(), _actionMap_, _fuelLevel_, _passengerDest_, _passengerPos_, _primeMap_, _taxiActions_, _taxiVars_, _xPos_, _yPos_, beginVariables(), gum::CLUB, endVariables(), gum::FillUp, gum::GoEast, gum::GoNorth, gum::GoSouth, gum::GoWest, gum::HOME, gum::PickUp, primeVar(), gum::PutDown, gum::TAXI, gum::THEATER, and gum::WORK.
Referenced by TaxiSimulator(), and ~TaxiSimulator().
| gum::TaxiSimulator::~TaxiSimulator | ( | ) |
Default destructor.
Definition at line 127 of file taxiSimulator.cpp.
References TaxiSimulator(), and _primeMap_.
|
private |
Definition at line 333 of file taxiSimulator.cpp.
References _fuelLevel_, _isAtDestination_(), _isAtMeetPoint_(), _lastAction_, _passengerDest_, _passengerPos_, _reward_, _xPos_, _yPos_, gum::AbstractSimulator::currentState_, gum::FillUp, gum::PickUp, gum::PutDown, gum::STATIONX, gum::STATIONY, and gum::TAXI.
Referenced by perform().
|
private |
Definition at line 372 of file taxiSimulator.cpp.
References gum::CLUB, gum::CLUBX, gum::CLUBY, gum::HOME, gum::HOMEX, gum::HOMEY, gum::TAXI, gum::THEATER, gum::THEATERX, gum::THEATERY, gum::WORK, gum::WORKX, and gum::WORKY.
Referenced by _evalReward_().
|
private |
Definition at line 397 of file taxiSimulator.cpp.
References gum::CLUB, gum::CLUBX, gum::CLUBY, gum::HOME, gum::HOMEX, gum::HOMEY, gum::TAXI, gum::THEATER, gum::THEATERX, gum::THEATERY, gum::WORK, gum::WORKX, and gum::WORKY.
Referenced by _evalReward_().
|
private |
Iteration over the variables of the simulated probleme.
Definition at line 321 of file taxiSimulator.cpp.
References _fuelLevel_, _xPos_, _yPos_, gum::AbstractSimulator::currentState_, gum::STATIONX, and gum::STATIONY.
Referenced by perform().
|
private |
Iteration over the variables of the simulated probleme.
Definition at line 214 of file taxiSimulator.cpp.
References _xPos_, _yPos_, and gum::AbstractSimulator::currentState_.
Referenced by perform().
|
private |
Iteration over the variables of the simulated probleme.
Definition at line 206 of file taxiSimulator.cpp.
References _yPos_, and gum::AbstractSimulator::currentState_.
Referenced by perform().
|
private |
Iteration over the variables of the simulated probleme.
Definition at line 230 of file taxiSimulator.cpp.
References _yPos_, and gum::AbstractSimulator::currentState_.
Referenced by perform().
|
private |
Iteration over the variables of the simulated probleme.
Definition at line 238 of file taxiSimulator.cpp.
References _xPos_, _yPos_, and gum::AbstractSimulator::currentState_.
Referenced by perform().
|
private |
Iteration over the variables of the simulated probleme.
Definition at line 254 of file taxiSimulator.cpp.
References _passengerPos_, _xPos_, _yPos_, gum::CLUB, gum::CLUBX, gum::CLUBY, gum::AbstractSimulator::currentState_, gum::HOME, gum::HOMEX, gum::HOMEY, gum::TAXI, gum::THEATER, gum::THEATERX, gum::THEATERY, gum::WORK, gum::WORKX, and gum::WORKY.
Referenced by perform().
|
private |
Iteration over the variables of the simulated probleme.
Definition at line 285 of file taxiSimulator.cpp.
References _passengerDest_, _passengerPos_, _xPos_, _yPos_, gum::CLUB, gum::CLUBX, gum::CLUBY, gum::AbstractSimulator::currentState_, gum::HOME, gum::HOMEX, gum::HOMEY, gum::TAXI, gum::THEATER, gum::THEATERX, gum::THEATERY, gum::WORK, gum::WORKX, and gum::WORKY.
Referenced by perform().
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 156 of file taxiSimulator.h.
References _actionMap_.
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 159 of file taxiSimulator.h.
References _taxiActions_.
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 143 of file taxiSimulator.h.
References _taxiVars_.
Referenced by TaxiSimulator().
|
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 161 of file taxiSimulator.h.
References _taxiActions_.
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 147 of file taxiSimulator.h.
References _taxiVars_.
Referenced by TaxiSimulator().
|
virtual |
Choses a random state as the first test for a run.
Reimplemented from gum::AbstractSimulator.
Definition at line 165 of file taxiSimulator.cpp.
|
virtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 184 of file taxiSimulator.cpp.
References _evalReward_(), _fuelLevel_, _lastAction_, _performFillUp_(), _performGoEast_(), _performGoNorth_(), _performGoSouth_(), _performGoWest_(), _performPickUp_(), _performPutDown_(), gum::AbstractSimulator::currentState_, gum::FillUp, gum::GoEast, gum::GoNorth, gum::GoSouth, gum::GoWest, gum::PickUp, and gum::PutDown.
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 138 of file taxiSimulator.h.
References _primeMap_.
Referenced by TaxiSimulator().
|
protectedvirtual |
Choses a random state as the first test for a run.
Reimplemented from gum::AbstractSimulator.
Definition at line 142 of file taxiSimulator.cpp.
References gum::AbstractSimulator::randomState_().
|
virtual |
Sets the intial statefrom which we begun the simulation.
Implements gum::AbstractSimulator.
Definition at line 179 of file taxiSimulator.cpp.
References _reward_.
|
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_().
Definition at line 206 of file taxiSimulator.h.
Referenced by TaxiSimulator(), and actionName().
|
private |
Definition at line 202 of file taxiSimulator.h.
Referenced by TaxiSimulator(), _evalReward_(), _performFillUp_(), and perform().
|
private |
Definition at line 208 of file taxiSimulator.h.
Referenced by _evalReward_(), and perform().
|
private |
Definition at line 201 of file taxiSimulator.h.
Referenced by TaxiSimulator(), _evalReward_(), and _performPutDown_().
|
private |
Definition at line 200 of file taxiSimulator.h.
Referenced by TaxiSimulator(), _evalReward_(), _performPickUp_(), and _performPutDown_().
|
private |
Definition at line 197 of file taxiSimulator.h.
Referenced by TaxiSimulator(), ~TaxiSimulator(), and primeVar().
|
private |
Actions.
Definition at line 205 of file taxiSimulator.h.
Referenced by TaxiSimulator(), beginActions(), and endActions().
|
private |
Variables data structures.
Definition at line 196 of file taxiSimulator.h.
Referenced by TaxiSimulator(), beginVariables(), and endVariables().
|
private |
Definition at line 198 of file taxiSimulator.h.
Referenced by TaxiSimulator(), _evalReward_(), _performFillUp_(), _performGoEast_(), _performGoWest_(), _performPickUp_(), and _performPutDown_().
|
private |
Definition at line 199 of file taxiSimulator.h.
Referenced by TaxiSimulator(), _evalReward_(), _performFillUp_(), _performGoEast_(), _performGoNorth_(), _performGoSouth_(), _performGoWest_(), _performPickUp_(), and _performPutDown_().
|
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().