aGrUM 3.1.1
a C++ library for (probabilistic) graphical models
factorySimulator.h
Go to the documentation of this file.
1/****************************************************************************
2 * This file is part of the aGrUM/pyAgrum library. *
3 * *
4 * Copyright (c) 2005-2026 by *
5 * - Pierre-Henri WUILLEMIN(_at_LIP6) *
6 * - Christophe GONZALES(_at_AMU) *
7 * *
8 * The aGrUM/pyAgrum library is free software; you can redistribute it *
9 * and/or modify it under the terms of either : *
10 * *
11 * - the GNU Lesser General Public License as published by *
12 * the Free Software Foundation, either version 3 of the License, *
13 * or (at your option) any later version, *
14 * - the MIT license (MIT), *
15 * - or both in dual license, as here. *
16 * *
17 * (see https://agrum.gitlab.io/articles/dual-licenses-lgplv3mit.html) *
18 * *
19 * This aGrUM/pyAgrum library is distributed in the hope that it will be *
20 * useful, but WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
21 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES MERCHANTABILITY or FITNESS *
22 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
23 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
26 * OTHER DEALINGS IN THE SOFTWARE. *
27 * *
28 * See LICENCES for more details. *
29 * *
30 * SPDX-FileCopyrightText: Copyright 2005-2026 *
31 * - Pierre-Henri WUILLEMIN(_at_LIP6) *
32 * - Christophe GONZALES(_at_AMU) *
33 * SPDX-License-Identifier: LGPL-3.0-or-later OR MIT *
34 * *
35 * Contact : info_at_agrum_dot_org *
36 * homepage : http://agrum.gitlab.io *
37 * gitlab : https://gitlab.com/agrumery/agrum *
38 * *
39 ****************************************************************************/
40
41
49#ifndef GUM_FACTORY_SIMULATOR_H
50#define GUM_FACTORY_SIMULATOR_H
51//======================================================================
52//======================================================================
53//======================================================================
55
56//======================================================================
57//======================================================================
58
59namespace gum {
60
61
62 enum FactorySimulationLandmark : Idx { HOME = 0, WORK = 1, THEATER = 2, CLUB = 3, Factory = 4 };
63
71
79
89
90 // clang-format off
97 // clang-format on
98
100 public:
101 // ===========================================================================
103 // ===========================================================================
105
110
115
117
118 // ===========================================================================
120 // ===========================================================================
122
123 protected:
126
127 public:
130 double reward();
132
134
135 // ===========================================================================
137 // ===========================================================================
139
140 const DiscreteVariable* primeVar(const DiscreteVariable* mainVar);
141
144
146
148
149 // ===========================================================================
151 // ===========================================================================
153
154 const std::string& actionName(Idx actionId);
155
158
160
162
163
164 private:
165 void _goNorth_();
166 void _goEast_();
167 void _goSouth_();
168 void _goWest_();
169 void _pickUp_();
170 void _putDown_();
171 void _fillUp_();
172
181
184 HashTable< Idx, std::string* > _actionMap_; // __actionMap.insert ( actionId,
185 // new std::string ( action ) );
187 };
188
189} /* namespace gum */
190
191#ifndef GUM_NO_INLINE
193#endif // GUM_NO_INLINE
194#endif // GUM_FACTORY_SIMULATOR_H
Class for simulating a discrete time stochastic process.
AbstractSimulator()
Default constructor.
Set of pairs of elements with fast search for both elements.
Definition bijection.h:1640
Base class for discrete random variable.
DiscreteVariable * _passengerDest_
const std::string & actionName(Idx actionId)
Iteration over the variables of the simulated probleme.
Instantiation randomState_()
Choses a random state as the first test for a run.
FactorySimulationAction _lastAction_
SequenceIteratorSafe< Idx > beginActions()
Iteration over the variables of the simulated probleme.
SequenceIteratorSafe< const DiscreteVariable * > beginVariables()
Iteration over the variables of the simulated probleme.
DiscreteVariable * _passengerPos_
FactorySimulator()
Default constructor.
bool hasReachEnd()
Choses a random state as the first test for a run.
Sequence< const DiscreteVariable * > _FactoryVars_
Variables data structures.
HashTable< Idx, std::string * > _actionMap_
void perform(Idx)
Choses a random state as the first test for a run.
const DiscreteVariable * primeVar(const DiscreteVariable *mainVar)
Iteration over the variables of the simulated probleme.
DiscreteVariable * _xPos_
DiscreteVariable * _fuelLevel_
double reward()
Choses a random state as the first test for a run.
SequenceIteratorSafe< const DiscreteVariable * > endVariables()
Iteration over the variables of the simulated probleme.
Bijection< const DiscreteVariable *, const DiscreteVariable * > _primeMap_
SequenceIteratorSafe< Idx > endActions()
Iteration over the variables of the simulated probleme.
~FactorySimulator()
Default destructor.
DiscreteVariable * _yPos_
Sequence< Idx > _FactoryActions_
Actions.
The class for generic Hash Tables.
Definition hashTable.h:640
Class for assigning/browsing values to tuples of discrete variables.
Safe iterators for Sequence.
Definition sequence.h:1148
The generic class for storing (ordered) sequences of objects.
Definition sequence.h:994
Size Idx
Type for indexes.
Definition types.h:79
gum is the global namespace for all aGrUM entities
Definition agrum.h:46
FactorySimulationLandmark
FactorySimulationAction
FactorySimulationLandmarkY
FactorySimulationLandmarkX