72 for (
Idx pos = 0; pos < 5; pos++) {
73 _xPos_->addLabel(std::to_string(pos));
74 _yPos_->addLabel(std::to_string(pos));
105 primeVar->setName((*varIter)->name() +
"'");
136 delete varIter.first();
137 delete varIter.second();
220 if (xCurPos == 4)
return;
221 if (xCurPos == 0 || xCurPos == 2)
222 if (yCurPos == 0 || yCurPos == 1)
return;
224 if (yCurPos == 3 || yCurPos == 4)
return;
244 if (xCurPos == 0)
return;
245 if (xCurPos == 1 || xCurPos == 3)
246 if (yCurPos == 0 || yCurPos == 1)
return;
248 if (yCurPos == 3 || yCurPos == 4)
return;
296 if (passPos ==
TAXI) {
346 if (passPos ==
TAXI) {
379 if (xCurPos ==
HOMEX && yCurPos ==
HOMEY)
return true;
383 if (xCurPos ==
WORKX && yCurPos ==
WORKY)
return true;
391 if (xCurPos ==
CLUBX && yCurPos ==
CLUBY)
return true;
394 case TAXI :
return false;
404 if (xCurPos ==
HOMEX && yCurPos ==
HOMEY)
return true;
408 if (xCurPos ==
WORKX && yCurPos ==
WORKY)
return true;
416 if (xCurPos ==
CLUBX && yCurPos ==
CLUBY)
return true;
419 case TAXI :
return false;
AbstractSimulator()
Default constructor.
virtual Instantiation randomState_()
Choses a random state as the first test for a run.
Instantiation currentState_
Tha state in which the system currently is.
Safe iterators for bijectionIterator.
Base class for discrete random variable.
Class for assigning/browsing values to tuples of discrete variables.
Safe iterators for Sequence.
Sequence< Idx > _taxiActions_
Actions.
bool _isAtDestination_(TaxiSimulationLandmark passDest, TaxiSimulationLandmarkX xCurPos, TaxiSimulationLandmarkY yCurPos)
LabelizedVariable * _yPos_
Bijection< const DiscreteVariable *, const DiscreteVariable * > _primeMap_
LabelizedVariable * _xPos_
TaxiSimulator()
Default constructor.
double reward() override
Sets the intial statefrom which we begun the simulation.
void perform(Idx) override
Sets the intial statefrom which we begun the simulation.
bool hasReachEnd() override
Choses a random state as the first test for a run.
Sequence< const DiscreteVariable * > _taxiVars_
Variables data structures.
const DiscreteVariable * primeVar(const DiscreteVariable *mainVar) override
Iteration over the variables of the simulated probleme.
TaxiSimulationAction _lastAction_
LabelizedVariable * _passengerDest_
LabelizedVariable * _passengerPos_
~TaxiSimulator() override
Default destructor.
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.
LabelizedVariable * _fuelLevel_
HashTable< Idx, std::string * > _actionMap_
Instantiation randomState_() override
Choses a random state as the first test for a run.
bool _isAtMeetPoint_(TaxiSimulationLandmark passpos, TaxiSimulationLandmarkX xCurPos, TaxiSimulationLandmarkY yCurPos)
Size Idx
Type for indexes.
gum is the global namespace for all aGrUM entities
Class for simulating a markov decision process.