![]() |
aGrUM
0.16.0
|
A class to simulate the Taxi problem. More...
#include <agrum/FMDP/simulation/taxiSimulator.h>
Public Attributes | |
Instantiation | _currentState |
Tha state in which the system currently is. More... | |
Instantiation | _endState |
Public Member Functions | |
Constructors, Destructors. | |
TaxiSimulator () | |
Default constructor. More... | |
~TaxiSimulator () | |
Default destructor. More... | |
Variables | |
const DiscreteVariable * | primeVar (const DiscreteVariable *mainVar) |
Iteration over the variables of the simulated probleme. More... | |
SequenceIteratorSafe< const DiscreteVariable *> | beginVariables () |
Iteration over the variables of the simulated probleme. More... | |
SequenceIteratorSafe< const DiscreteVariable *> | endVariables () |
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... | |
INLINE const Instantiation & | currentState () |
Sets the intial statefrom which we begun the simulation. More... | |
States | |
bool | hasReachEnd () |
Choses a random state as the first test for a run. More... | |
Instantiation | _randomState () |
Choses a random state as the first test for a run. More... | |
Actions | |
const std::string & | actionName (Idx actionId) |
Iteration over the variables of the simulated probleme. More... | |
SequenceIteratorSafe< Idx > | beginActions () |
Iteration over the variables of the simulated probleme. More... | |
SequenceIteratorSafe< Idx > | endActions () |
Iteration over the variables of the simulated probleme. More... | |
void | perform (Idx) |
Iteration over the variables of the simulated probleme. More... | |
void | __performGoNorth () |
Iteration over the variables of the simulated probleme. More... | |
void | __performGoEast () |
Iteration over the variables of the simulated probleme. More... | |
void | __performGoSouth () |
Iteration over the variables of the simulated probleme. More... | |
void | __performGoWest () |
Iteration over the variables of the simulated probleme. More... | |
void | __performPickUp () |
Iteration over the variables of the simulated probleme. More... | |
void | __performPutDown () |
Iteration over the variables of the simulated probleme. More... | |
void | __performFillUp () |
Iteration over the variables of the simulated probleme. More... | |
Rewards | |
double | reward () |
Sets the intial statefrom which we begun the simulation. More... | |
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 83 of file taxiSimulator.h.
gum::TaxiSimulator::TaxiSimulator | ( | ) |
Default constructor.
Definition at line 39 of file taxiSimulator.cpp.
References __actionMap, __fuelLevel, __passengerDest, __passengerPos, __primeMap, __taxiActions, __taxiVars, __xPos, __yPos, gum::LabelizedVariable::addLabel(), beginVariables(), gum::LabelizedVariable::changeLabel(), gum::DiscreteVariable::clone(), gum::CLUB, endVariables(), gum::LabelizedVariable::eraseLabels(), gum::FillUp, gum::GoEast, gum::GoNorth, gum::GoSouth, gum::GoWest, gum::HOME, gum::SequenceImplementation< Key, Alloc, Gen >::insert(), gum::HashTable< Key, Val, Alloc >::insert(), gum::PickUp, primeVar(), gum::PutDown, gum::Variable::setName(), gum::TAXI, gum::THEATER, and gum::WORK.
gum::TaxiSimulator::~TaxiSimulator | ( | ) |
Default destructor.
Definition at line 112 of file taxiSimulator.cpp.
References __primeMap.
|
private |
Definition at line 337 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, gum::TAXI, and gum::Instantiation::valFromPtr().
Referenced by endActions(), and perform().
|
private |
Definition at line 380 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(), and endActions().
|
private |
Definition at line 405 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(), and endActions().
|
private |
Iteration over the variables of the simulated probleme.
Definition at line 323 of file taxiSimulator.cpp.
References __fuelLevel, __xPos, __yPos, gum::AbstractSimulator::_currentState, gum::Instantiation::chgVal(), gum::STATIONX, gum::STATIONY, and gum::Instantiation::valFromPtr().
Referenced by endActions(), and perform().
|
private |
Iteration over the variables of the simulated probleme.
Definition at line 204 of file taxiSimulator.cpp.
References __xPos, __yPos, gum::AbstractSimulator::_currentState, gum::Instantiation::chgVal(), and gum::Instantiation::valFromPtr().
Referenced by endActions(), and perform().
|
private |
Iteration over the variables of the simulated probleme.
Definition at line 195 of file taxiSimulator.cpp.
References __yPos, gum::AbstractSimulator::_currentState, gum::Instantiation::chgVal(), and gum::Instantiation::valFromPtr().
Referenced by endActions(), and perform().
|
private |
Iteration over the variables of the simulated probleme.
Definition at line 221 of file taxiSimulator.cpp.
References __yPos, gum::AbstractSimulator::_currentState, gum::Instantiation::chgVal(), and gum::Instantiation::valFromPtr().
Referenced by endActions(), and perform().
|
private |
Iteration over the variables of the simulated probleme.
Definition at line 230 of file taxiSimulator.cpp.
References __xPos, __yPos, gum::AbstractSimulator::_currentState, gum::Instantiation::chgVal(), and gum::Instantiation::valFromPtr().
Referenced by endActions(), and perform().
|
private |
Iteration over the variables of the simulated probleme.
Definition at line 247 of file taxiSimulator.cpp.
References __passengerPos, __xPos, __yPos, gum::AbstractSimulator::_currentState, gum::Instantiation::chgVal(), gum::CLUB, gum::CLUBX, gum::CLUBY, gum::HOME, gum::HOMEX, gum::HOMEY, gum::TAXI, gum::THEATER, gum::THEATERX, gum::THEATERY, gum::Instantiation::valFromPtr(), gum::WORK, gum::WORKX, and gum::WORKY.
Referenced by endActions(), and perform().
|
private |
Iteration over the variables of the simulated probleme.
Definition at line 283 of file taxiSimulator.cpp.
References __passengerDest, __passengerPos, __xPos, __yPos, gum::AbstractSimulator::_currentState, gum::Instantiation::chgVal(), gum::CLUB, gum::CLUBX, gum::CLUBY, gum::HOME, gum::HOMEX, gum::HOMEY, gum::TAXI, gum::THEATER, gum::THEATERX, gum::THEATERY, gum::Instantiation::valFromPtr(), gum::WORK, gum::WORKX, and gum::WORKY.
Referenced by endActions(), and perform().
|
protectedvirtual |
Choses a random state as the first test for a run.
Reimplemented from gum::AbstractSimulator.
Definition at line 128 of file taxiSimulator.cpp.
References gum::AbstractSimulator::_randomState().
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 140 of file taxiSimulator.h.
References __actionMap.
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 143 of file taxiSimulator.h.
References __taxiActions, and gum::SequenceImplementation< Key, Alloc, Gen >::beginSafe().
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 126 of file taxiSimulator.h.
References __taxiVars.
Referenced by TaxiSimulator().
|
inlineinherited |
Sets the intial statefrom which we begun the simulation.
Definition at line 92 of file abstractSimulator.h.
References gum::AbstractSimulator::_currentState, gum::AbstractSimulator::actionName(), gum::AbstractSimulator::beginActions(), gum::AbstractSimulator::beginVariables(), gum::AbstractSimulator::endActions(), gum::AbstractSimulator::endVariables(), gum::AbstractSimulator::perform(), gum::AbstractSimulator::primeVar(), and gum::AbstractSimulator::reward().
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 146 of file taxiSimulator.h.
References __evalReward(), __isAtDestination(), __isAtMeetPoint(), __performFillUp(), __performGoEast(), __performGoNorth(), __performGoSouth(), __performGoWest(), __performPickUp(), __performPutDown(), __taxiActions, gum::SequenceImplementation< Key, Alloc, Gen >::endSafe(), perform(), and reward().
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 129 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 152 of file taxiSimulator.cpp.
|
virtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 172 of file taxiSimulator.cpp.
References __evalReward(), __fuelLevel, __lastAction, __performFillUp(), __performGoEast(), __performGoNorth(), __performGoSouth(), __performGoWest(), __performPickUp(), __performPutDown(), gum::AbstractSimulator::_currentState, gum::Instantiation::chgVal(), gum::FillUp, gum::GoEast, gum::GoNorth, gum::GoSouth, gum::GoWest, gum::PickUp, gum::PutDown, and gum::Instantiation::valFromPtr().
Referenced by endActions().
|
inlinevirtual |
Iteration over the variables of the simulated probleme.
Implements gum::AbstractSimulator.
Definition at line 121 of file taxiSimulator.h.
References __primeMap.
Referenced by TaxiSimulator().
|
virtual |
Sets the intial statefrom which we begun the simulation.
Implements gum::AbstractSimulator.
Definition at line 167 of file taxiSimulator.cpp.
References __reward.
Referenced by endActions().
|
inlineinherited |
Sets the final states upon which a run is over.
Definition at line 84 of file abstractSimulator.h.
References gum::AbstractSimulator::_endState, and gum::AbstractSimulator::hasReachEnd().
|
inlineinherited |
Sets the intial statefrom which we begun the simulation.
Definition at line 73 of file abstractSimulator.h.
References gum::AbstractSimulator::_currentState, gum::AbstractSimulator::_randomState(), and gum::AbstractSimulator::setInitialStateRandomly().
|
inherited |
Sets the intial statefrom which we begun the simulation.
Definition at line 58 of file abstractSimulator.cpp.
References gum::AbstractSimulator::_currentState, gum::AbstractSimulator::_randomState(), and gum::AbstractSimulator::hasReachEnd().
Referenced by gum::AbstractSimulator::setInitialState().
Definition at line 191 of file taxiSimulator.h.
Referenced by actionName(), and TaxiSimulator().
|
private |
Definition at line 187 of file taxiSimulator.h.
Referenced by __evalReward(), __performFillUp(), perform(), and TaxiSimulator().
|
private |
Definition at line 193 of file taxiSimulator.h.
Referenced by __evalReward(), and perform().
|
private |
Definition at line 186 of file taxiSimulator.h.
Referenced by __evalReward(), __performPutDown(), and TaxiSimulator().
|
private |
Definition at line 185 of file taxiSimulator.h.
Referenced by __evalReward(), __performPickUp(), __performPutDown(), and TaxiSimulator().
|
private |
Definition at line 182 of file taxiSimulator.h.
Referenced by primeVar(), TaxiSimulator(), and ~TaxiSimulator().
|
private |
Actions.
Definition at line 190 of file taxiSimulator.h.
Referenced by beginActions(), endActions(), and TaxiSimulator().
|
private |
Variables data structures.
Definition at line 181 of file taxiSimulator.h.
Referenced by beginVariables(), endVariables(), and TaxiSimulator().
|
private |
Definition at line 183 of file taxiSimulator.h.
Referenced by __evalReward(), __performFillUp(), __performGoEast(), __performGoWest(), __performPickUp(), __performPutDown(), and TaxiSimulator().
|
private |
Definition at line 184 of file taxiSimulator.h.
Referenced by __evalReward(), __performFillUp(), __performGoEast(), __performGoNorth(), __performGoSouth(), __performGoWest(), __performPickUp(), __performPutDown(), and TaxiSimulator().
|
inherited |
Tha state in which the system currently is.
Definition at line 130 of file abstractSimulator.h.
Referenced by __evalReward(), __performFillUp(), __performGoEast(), __performGoNorth(), __performGoSouth(), __performGoWest(), __performPickUp(), __performPutDown(), gum::AbstractSimulator::currentState(), gum::AbstractSimulator::hasReachEnd(), gum::FMDPSimulator::perform(), perform(), gum::FMDPSimulator::reward(), gum::AbstractSimulator::setInitialState(), and gum::AbstractSimulator::setInitialStateRandomly().
|
inherited |
Definition at line 130 of file abstractSimulator.h.
Referenced by gum::AbstractSimulator::hasReachEnd(), and gum::AbstractSimulator::setEndState().