51 for (
Idx pos = 0; pos < 5; pos++) {
88 primeVar->
setName((*varIter)->name() +
"'");
119 delete varIter.first();
120 delete varIter.second();
208 if (xCurPos == 4)
return;
209 if (xCurPos == 0 || xCurPos == 2)
210 if (yCurPos == 0 || yCurPos == 1)
return;
212 if (yCurPos == 3 || yCurPos == 4)
return;
234 if (xCurPos == 0)
return;
235 if (xCurPos == 1 || xCurPos == 3)
236 if (yCurPos == 0 || yCurPos == 1)
return;
238 if (yCurPos == 3 || yCurPos == 4)
return;
292 if (passPos ==
TAXI) {
348 if (passPos ==
TAXI) {
385 if (xCurPos ==
HOMEX && yCurPos ==
HOMEY)
return true;
389 if (xCurPos ==
WORKX && yCurPos ==
WORKY)
return true;
397 if (xCurPos ==
CLUBX && yCurPos ==
CLUBY)
return true;
400 case TAXI:
return false;
410 if (xCurPos ==
HOMEX && yCurPos ==
HOMEY)
return true;
414 if (xCurPos ==
WORKX && yCurPos ==
WORKY)
return true;
422 if (xCurPos ==
CLUBX && yCurPos ==
CLUBY)
return true;
425 case TAXI:
return false;
void perform(Idx)
Iteration over the variables of the simulated probleme.
Safe iterators for Sequence.
void setName(const std::string &theValue)
sets the name of the variable
void __performFillUp()
Iteration over the variables of the simulated probleme.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void __performGoEast()
Iteration over the variables of the simulated probleme.
Idx valFromPtr(const DiscreteVariable *pvar) const
Returns the current value of a given variable.
void changeLabel(Idx pos, const std::string &aLabel) const
change a label for this index
void __performGoNorth()
Iteration over the variables of the simulated probleme.
<agrum/FMDP/simulation/abstractSimulator.h>
SequenceIteratorSafe< const DiscreteVariable *> beginVariables()
Iteration over the variables of the simulated probleme.
LabelizedVariable * __passengerDest
const DiscreteVariable * primeVar(const DiscreteVariable *mainVar)
Iteration over the variables of the simulated probleme.
Safe iterators for bijectionIterator.
LabelizedVariable * __xPos
SequenceIteratorSafe< const DiscreteVariable *> endVariables()
Iteration over the variables of the simulated probleme.
virtual DiscreteVariable * clone() const =0
Copy Factory.
LabelizedVariable * __yPos
void eraseLabels()
erase all the labels
void __performGoWest()
Iteration over the variables of the simulated probleme.
Instantiation & chgVal(const DiscreteVariable &v, Idx newval)
Assign newval to variable v in the Instantiation.
Base class for discrete random variable.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Instantiation _currentState
Tha state in which the system currently is.
bool hasReachEnd()
Choses a random state as the first test for a run.
Bijection< const DiscreteVariable *, const DiscreteVariable *> __primeMap
LabelizedVariable * __fuelLevel
double reward()
Sets the intial statefrom which we begun the simulation.
bool __isAtMeetPoint(TaxiSimulationLandmark passpos, TaxiSimulationLandmarkX xCurPos, TaxiSimulationLandmarkY yCurPos)
HashTable< Idx, std::string *> __actionMap
void __performGoSouth()
Iteration over the variables of the simulated probleme.
virtual Instantiation _randomState()
Choses a random state as the first test for a run.
A class to simulate the Taxi problem.
Sequence< const DiscreteVariable *> __taxiVars
Variables data structures.
~TaxiSimulator()
Default destructor.
Class for assigning/browsing values to tuples of discrete variables.
LabelizedVariable * __passengerPos
Instantiation _randomState()
Choses a random state as the first test for a run.
void __performPutDown()
Iteration over the variables of the simulated probleme.
Size Idx
Type for indexes.
void __performPickUp()
Iteration over the variables of the simulated probleme.
Sequence< Idx > __taxiActions
Actions.
TaxiSimulator()
Default constructor.
value_type & insert(const Key &key, const Val &val)
Adds a new element (actually a copy of this element) into the hash table.
LabelizedVariable & addLabel(const std::string &aLabel)
add a label with a new index (we assume that we will NEVER remove a label)
bool __isAtDestination(TaxiSimulationLandmark passDest, TaxiSimulationLandmarkX xCurPos, TaxiSimulationLandmarkY yCurPos)
TaxiSimulationAction __lastAction
void insert(const Key &k)
Insert an element at the end of the sequence.