aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
treeOperatorStrategy.h
Go to the documentation of this file.
1/****************************************************************************
2 * This file is part of the aGrUM/pyAgrum library. *
3 * *
4 * Copyright (c) 2005-2025 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-2025 *
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
48
49// =========================================================================
50#ifndef GUM_TreeOperatorStrategy_H
51#define GUM_TreeOperatorStrategy_H
52// =========================================================================
54
55// =========================================================================
56
57namespace gum {
58
69 template < typename GUM_SCALAR >
70 class TreeOperatorStrategy: public IOperatorStrategy< GUM_SCALAR > {
71 // ###################################################################
73 // ###################################################################
75
76 public:
77 // ==========================================================================
79 // ==========================================================================
81
82 // ==========================================================================
84 // ==========================================================================
86
88
89
90 // ###################################################################
92 // ###################################################################
94
95 public:
99
105
109
111
112 // ###################################################################
114 // ###################################################################
116
117 protected:
118 // ==========================================================================
121 // ==========================================================================
123 Idx actionId,
124 const FMDP< GUM_SCALAR >* fmdp,
125 const gum::VariableSet& elVarSeq);
126
127 // ==========================================================================
129 // ==========================================================================
133 Idx del = 3);
134
135 // ==========================================================================
137 // ==========================================================================
141 Idx del = 3);
142
143 // ==========================================================================
145 // ==========================================================================
149 Idx del = 3);
150
151 // ==========================================================================
153 // ==========================================================================
158 Idx del = 3);
159
160 // ==========================================================================
162 // ==========================================================================
165 Idx del = 1);
166
167 // ==========================================================================
169 // ==========================================================================
173 Idx del = 0);
174
175
177 };
178} /* namespace gum */
179
181
182#endif // GUM_TreeOperatorStrategy_H
Headers of the Operator Strategy interface.
Class to handle efficiently argMaxSet.
Definition argMaxSet.h:78
This class is used to implement factored decision process.
Definition fmdp.h:73
<agrum/FMDP/SDyna/IOperatorStrategy.h>
static MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * getTreeInstance()
Returns an arborescent instance.
Implementation of a Terminal Node Policy that maps nodeid to a set of value.
virtual MultiDimFunctionGraph< GUM_SCALAR > * add(const MultiDimFunctionGraph< GUM_SCALAR > *f1, const MultiDimFunctionGraph< GUM_SCALAR > *f2, Idx del=1)
Adds reward to given function( whether a f2 or f1).
MultiDimFunctionGraph< GUM_SCALAR > * regress(const MultiDimFunctionGraph< GUM_SCALAR > *Vold, Idx actionId, const FMDP< GUM_SCALAR > *fmdp, const gum::VariableSet &elVarSeq)
Computes Qaction for given actionid.
MultiDimFunctionGraph< ActionSet, SetTerminalNodePolicy > * getAggregatorInstance()
virtual MultiDimFunctionGraph< GUM_SCALAR > * multiply(const MultiDimFunctionGraph< GUM_SCALAR > *f1, const MultiDimFunctionGraph< GUM_SCALAR > *f2, Idx del=3)
MultiDimFunctionGraph< ArgMaxSet< GUM_SCALAR, Idx >, SetTerminalNodePolicy > * getArgMaxFunctionInstance()
virtual MultiDimFunctionGraph< GUM_SCALAR > * minimize(const MultiDimFunctionGraph< GUM_SCALAR > *f1, const MultiDimFunctionGraph< GUM_SCALAR > *f2, Idx del=3)
virtual MultiDimFunctionGraph< GUM_SCALAR > * maximize(const MultiDimFunctionGraph< GUM_SCALAR > *f1, const MultiDimFunctionGraph< GUM_SCALAR > *f2, Idx del=3)
TreeOperatorStrategy()
Default constructor.
~TreeOperatorStrategy()
Default destructor.
virtual MultiDimFunctionGraph< GUM_SCALAR > * subtract(const MultiDimFunctionGraph< GUM_SCALAR > *f1, const MultiDimFunctionGraph< GUM_SCALAR > *f2, Idx del=0)
Subtract current f1 from old f1 to see if threshold is reached or not.
MultiDimFunctionGraph< GUM_SCALAR, ExactTerminalNodePolicy > * getFunctionInstance()
virtual MultiDimFunctionGraph< ArgMaxSet< GUM_SCALAR, Idx >, SetTerminalNodePolicy > * argmaximize(const MultiDimFunctionGraph< ArgMaxSet< GUM_SCALAR, Idx >, SetTerminalNodePolicy > *f1, const MultiDimFunctionGraph< ArgMaxSet< GUM_SCALAR, Idx >, SetTerminalNodePolicy > *f2, Idx del=3)
ArgMaximizes between f2 and f1.
Size Idx
Type for indexes.
Definition types.h:79
gum is the global namespace for all aGrUM entities
Definition agrum.h:46
Set< const DiscreteVariable * > VariableSet
Template implementation of FMDP/planning/TreeOperatorStrategy.h classes.