aGrUM 3.1.1
a C++ library for (probabilistic) graphical models
actionSet.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
50// =========================================================================
51#ifndef GUM_ACTION_SET_H
52#define GUM_ACTION_SET_H
53// =========================================================================
54#include <thread>
55// =========================================================================
58// =========================================================================
60// =========================================================================
61#include <agrum/FMDP/fmdp.h>
62
63// =========================================================================
64
65namespace gum {
66
75 template < typename GUM_ELEMENT >
77 // ###########################################################################
79 // ###########################################################################
81
82 const GUM_ELEMENT& operator()(const GUM_ELEMENT& x, const GUM_ELEMENT& y) const;
83
84 private:
85 mutable GUM_ELEMENT _temp_;
86 };
87
98 class ActionSet {
99 public:
100 // ###########################################################################
102 // ###########################################################################
104
105 // ============================================================================
107 // ============================================================================
108 ActionSet();
109
110 ActionSet(const ActionSet& src);
111
112 ActionSet& operator=(const ActionSet& src);
113
114 // ============================================================================
116 // ============================================================================
117 ~ActionSet();
118
119 // ============================================================================
121 // ============================================================================
122 void* operator new(size_t s);
123
124 void operator delete(void* p);
125
127
128 // ###########################################################################
130 // ###########################################################################
132
133 // ============================================================================
135 // ============================================================================
137
138 // ============================================================================
140 // ============================================================================
142
144
145 // ###########################################################################
147 // ###########################################################################
149
150 // ============================================================================
152 // ============================================================================
153 ActionSet& operator+=(const Idx& elem);
154
155 // ============================================================================
157 // ============================================================================
158 ActionSet& operator+=(const ActionSet& src);
159
160 // ============================================================================
162 // ============================================================================
163 ActionSet& operator-=(const ActionSet& src);
164
165 // ============================================================================
167 // ============================================================================
168 const Idx& operator[](const Idx i) const { return _actionSeq_->atPos(i); }
169
170 // ============================================================================
172 // ============================================================================
173 bool operator==(const ActionSet& compared) const;
174
176
177 // ============================================================================
179 // ============================================================================
180 Size size() const;
181
182 bool exists(const Idx& elem) const;
183
184 private:
187
188 friend std::ostream& operator<<(std::ostream& streamy, const ActionSet& objy);
189 };
190} // namespace gum
191
192#ifndef GUM_NO_INLINE
194#endif
196#endif // GUM_ACTION_SET_H
Headers of the ITerminalNodePolicy.
A class to store the optimal actions.
Definition actionSet.h:98
ActionSet & operator=(const ActionSet &src)
Constructor.
friend std::ostream & operator<<(std::ostream &streamy, const ActionSet &objy)
SequenceIteratorSafe< Idx > beginSafe() const
Iterator beginning.
bool exists(const Idx &elem) const
SequenceIteratorSafe< Idx > endSafe() const
Iterator end.
~ActionSet()
Destructor.
ActionSet & operator+=(const Idx &elem)
Ajout d'un élément.
ActionSet()
Constructor.
bool operator==(const ActionSet &compared) const
Compares two ActionSet to check if they are equals.
ActionSet & operator-=(const ActionSet &src)
Use to insert the content of another set inside this one.
Sequence< Idx > * _actionSeq_
The very bone of the ActionSet.
Definition actionSet.h:186
const Idx & operator[](const Idx i) const
Gives the ith element.
Definition actionSet.h:168
Size size() const
Gives the size.
Class for implementation of factored markov decision process.
This files contains several function objects that are not (yet) defined in the STL.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition types.h:74
Size Idx
Type for indexes.
Definition types.h:79
aGrUM's inline/outline selection
gum is the global namespace for all aGrUM entities
Definition agrum.h:46
<agrum/FMDP/planning/actionSet.h>
Definition actionSet.h:76
const GUM_ELEMENT & operator()(const GUM_ELEMENT &x, const GUM_ELEMENT &y) const