aGrUM
3.2.0
a C++ library for (probabilistic) graphical models
Toggle main menu visibility
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
// =========================================================================
56
#include <
agrum/base/core/functors.h
>
57
#include <
agrum/base/core/inline.h
>
58
// =========================================================================
59
#include <
agrum/base/multidim/utils/FunctionGraphUtilities/terminalNodePolicies/SetTerminalNodePolicy.h
>
60
// =========================================================================
61
#include <
agrum/FMDP/fmdp.h
>
62
63
// =========================================================================
64
65
namespace
gum
{
66
75
template
<
typename
GUM_ELEMENT >
76
struct
ArgumentMaximisesAction
{
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
GUM_PUBLIC_FMDP
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
// ============================================================================
136
SequenceIteratorSafe< Idx >
beginSafe
()
const
;
137
138
// ============================================================================
140
// ============================================================================
141
SequenceIteratorSafe< Idx >
endSafe
()
const
;
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
:
186
Sequence< Idx >
*
_actionSeq_
;
187
188
friend
GUM_PUBLIC_FMDP std::ostream&
operator<<
(std::ostream& streamy,
const
ActionSet
& objy);
189
};
190
}
// namespace gum
191
192
#ifndef GUM_NO_INLINE
193
# include <
agrum/FMDP/planning/actionSet_inl.h
>
194
#endif
195
#include <
agrum/FMDP/planning/actionSet_tpl.h
>
196
#endif
// GUM_ACTION_SET_H
SetTerminalNodePolicy.h
Headers of the ITerminalNodePolicy.
actionSet_inl.h
actionSet_tpl.h
gum::ActionSet
A class to store the optimal actions.
Definition
actionSet.h:98
gum::ActionSet::operator=
ActionSet & operator=(const ActionSet &src)
Constructor.
Definition
actionSet_inl.h:60
gum::ActionSet::operator<<
friend GUM_PUBLIC_FMDP std::ostream & operator<<(std::ostream &streamy, const ActionSet &objy)
Definition
actionSet_inl.h:115
gum::ActionSet::beginSafe
SequenceIteratorSafe< Idx > beginSafe() const
Iterator beginning.
Definition
actionSet_inl.h:80
gum::ActionSet::endSafe
SequenceIteratorSafe< Idx > endSafe() const
Iterator end.
Definition
actionSet_inl.h:84
gum::ActionSet::operator+=
ActionSet & operator+=(const Idx &elem)
Ajout d'un élément.
Definition
actionSet_inl.h:86
gum::ActionSet::ActionSet
ActionSet()
Constructor.
Definition
actionSet_inl.h:48
gum::ActionSet::operator-=
ActionSet & operator-=(const ActionSet &src)
Use to insert the content of another set inside this one.
Definition
actionSet_inl.h:97
gum::ActionSet::_actionSeq_
Sequence< Idx > * _actionSeq_
The very bone of the ActionSet.
Definition
actionSet.h:186
gum::ActionSet::operator[]
const Idx & operator[](const Idx i) const
Gives the ith element.
Definition
actionSet.h:168
gum::SequenceIteratorSafe< Idx >
gum::Sequence< Idx >
fmdp.h
Class for implementation of factored markov decision process.
functors.h
This files contains several function objects that are not (yet) defined in the STL.
gum::Size
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition
types.h:74
gum::Idx
Size Idx
Type for indexes.
Definition
types.h:79
inline.h
aGrUM's inline/outline selection
gum
gum is the global namespace for all aGrUM entities
Definition
agrum.h:46
gum::operator==
bool operator==(const HashTableIteratorSafe< Key, Val > &from) const noexcept
Checks whether two iterators are pointing toward equal elements.
gum::ArgumentMaximisesAction
<agrum/FMDP/planning/actionSet.h>
Definition
actionSet.h:76
gum::ArgumentMaximisesAction::operator()
const GUM_ELEMENT & operator()(const GUM_ELEMENT &x, const GUM_ELEMENT &y) const
Definition
actionSet_tpl.h:50
gum::ArgumentMaximisesAction::_temp_
GUM_ELEMENT _temp_
Definition
actionSet.h:85
aGrUM
3.2.0
© PHW&CG&others - 2022
DoXyGeN 1.18.0