![]() |
aGrUM 3.1.1
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 () override | |
| Default destructor. | |
Variables | |
| const DiscreteVariable * | primeVar (const DiscreteVariable *mainVar) override |
| Iteration over the variables of the simulated probleme. | |
| SequenceIteratorSafe< const DiscreteVariable * > | beginVariables () override |
| Iteration over the variables of the simulated probleme. | |
| SequenceIteratorSafe< const DiscreteVariable * > | endVariables () override |
| Iteration over the variables of the simulated probleme. | |
| 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. | |
| void | setEndState (const Instantiation &endState) |
| Sets the final states upon which a run is over. | |
| 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 () override |
| Choses a random state as the first test for a run. | |
| Instantiation | randomState_ () override |
| Choses a random state as the first test for a run. | |
Actions | |
| const std::string & | actionName (Idx actionId) override |
| Iteration over the variables of the simulated probleme. | |
| SequenceIteratorSafe< Idx > | beginActions () override |
| Iteration over the variables of the simulated probleme. | |
| SequenceIteratorSafe< Idx > | endActions () override |
| Iteration over the variables of the simulated probleme. | |
| void | perform (Idx) override |
| Sets the intial statefrom which we begun the simulation. | |
| void | _performGoNorth_ () |
| void | _performGoEast_ () |
| void | _performGoSouth_ () |
| void | _performGoWest_ () |
| void | _performPickUp_ () |
| void | _performPutDown_ () |
| void | _performFillUp_ () |
Rewards | |
| double | reward () override |
| 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 61 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().
|
override |
Default destructor.
Definition at line 129 of file taxiSimulator.cpp.
References TaxiSimulator(), and _primeMap_.
|
private |
Definition at line 335 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 374 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 399 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 323 of file taxiSimulator.cpp.
References _fuelLevel_, _xPos_, _yPos_, gum::AbstractSimulator::currentState_, gum::STATIONX, and gum::STATIONY.
Referenced by perform().
|
private |
Definition at line 216 of file taxiSimulator.cpp.
References _xPos_, _yPos_, and gum::AbstractSimulator::currentState_.
Referenced by perform().
|
private |
Definition at line 208 of file taxiSimulator.cpp.
References _yPos_, and gum::AbstractSimulator::currentState_.
Referenced by perform().
|
private |
Definition at line 232 of file taxiSimulator.cpp.
References _yPos_, and gum::AbstractSimulator::currentState_.
Referenced by perform().
|
private |
Definition at line 240 of file taxiSimulator.cpp.
References _xPos_, _yPos_, and gum::AbstractSimulator::currentState_.
Referenced by perform().
|
private |
Definition at line 256 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 |
Definition at line 287 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().
|
overridevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 60 of file taxiSimulator_inl.h.
References _actionMap_.
|
overridevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 64 of file taxiSimulator_inl.h.
References _taxiActions_.
|
overridevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 52 of file taxiSimulator_inl.h.
References _taxiVars_.
Referenced by TaxiSimulator().
|
inherited |
Sets the intial statefrom which we begun the simulation.
Definition at line 56 of file abstractSimulator_inl.h.
References currentState_.
|
overridevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 68 of file taxiSimulator_inl.h.
References _taxiActions_.
|
overridevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 56 of file taxiSimulator_inl.h.
References _taxiVars_.
Referenced by TaxiSimulator().
|
overridevirtual |
Choses a random state as the first test for a run.
Reimplemented from gum::AbstractSimulator.
Definition at line 167 of file taxiSimulator.cpp.
|
overridevirtual |
Sets the intial statefrom which we begun the simulation.
Implements gum::AbstractSimulator.
Definition at line 186 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.
|
overridevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 48 of file taxiSimulator_inl.h.
References _primeMap_.
Referenced by TaxiSimulator().
|
overrideprotectedvirtual |
Choses a random state as the first test for a run.
Reimplemented from gum::AbstractSimulator.
Definition at line 144 of file taxiSimulator.cpp.
References gum::AbstractSimulator::randomState_().
|
overridevirtual |
Sets the intial statefrom which we begun the simulation.
Implements gum::AbstractSimulator.
Definition at line 181 of file taxiSimulator.cpp.
References _reward_.
|
inherited |
Sets the final states upon which a run is over.
Definition at line 52 of file abstractSimulator_inl.h.
References endState_.
|
inherited |
Sets the intial statefrom which we begun the simulation.
Definition at line 48 of file abstractSimulator_inl.h.
References currentState_.
|
inherited |
Sets the intial statefrom which we begun the simulation.
Definition at line 86 of file abstractSimulator.cpp.
References currentState_, hasReachEnd(), and randomState_().
Definition at line 201 of file taxiSimulator.h.
Referenced by TaxiSimulator(), and actionName().
|
private |
Definition at line 197 of file taxiSimulator.h.
Referenced by TaxiSimulator(), _evalReward_(), _performFillUp_(), and perform().
|
private |
Definition at line 203 of file taxiSimulator.h.
Referenced by _evalReward_(), and perform().
|
private |
Definition at line 196 of file taxiSimulator.h.
Referenced by TaxiSimulator(), _evalReward_(), and _performPutDown_().
|
private |
Definition at line 195 of file taxiSimulator.h.
Referenced by TaxiSimulator(), _evalReward_(), _performPickUp_(), and _performPutDown_().
|
private |
Definition at line 192 of file taxiSimulator.h.
Referenced by TaxiSimulator(), ~TaxiSimulator(), and primeVar().
|
private |
Actions.
Definition at line 200 of file taxiSimulator.h.
Referenced by TaxiSimulator(), beginActions(), and endActions().
|
private |
Variables data structures.
Definition at line 191 of file taxiSimulator.h.
Referenced by TaxiSimulator(), beginVariables(), and endVariables().
|
private |
Definition at line 193 of file taxiSimulator.h.
Referenced by TaxiSimulator(), _evalReward_(), _performFillUp_(), _performGoEast_(), _performGoWest_(), _performPickUp_(), and _performPutDown_().
|
private |
Definition at line 194 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().