aGrUM 3.1.1
a C++ library for (probabilistic) graphical models
mddOperatorStrategy.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_MDD_OPERATOR_STRATEGY_H
52#define GUM_MDD_OPERATOR_STRATEGY_H
53// =========================================================================
55
56// =========================================================================
57
58namespace gum {
59
70 template < typename GUM_ELEMENT >
71 class MDDOperatorStrategy: public IOperatorStrategy< GUM_ELEMENT > {
72 public:
73 // ###################################################################
75 // ###################################################################
77
82
86 ~MDDOperatorStrategy() override;
87
89
90
91 // ###################################################################
93 // ###################################################################
95
97
100
102
104
105 // ###################################################################
107 // ###################################################################
109
110 protected:
111 // ==========================================================================
115 // ==========================================================================
117 Idx actionId,
118 const FMDP< GUM_ELEMENT >* fmdp,
119 const gum::VariableSet& elVarSeq) override;
120
121 // ==========================================================================
123 // ==========================================================================
126 Idx del = 3) override;
127
128 // ==========================================================================
130 // ==========================================================================
133 Idx del = 3) override;
134
135 // ==========================================================================
137 // ==========================================================================
140 Idx del = 3) override;
141
142 // ==========================================================================
144 // ==========================================================================
148 Idx del = 3) override;
149
150 // ==========================================================================
152 // ==========================================================================
155 Idx del = 1) override;
156
157 // ==========================================================================
159 // ==========================================================================
162 Idx del = 0) override;
163
164
166
167 protected:
168 // ==========================================================================
171 // ==========================================================================
172 bool shouldEleminateVar_(const DiscreteVariable* v, const FMDP< GUM_ELEMENT >* fmdp);
173
174 // ==========================================================================
177 // ==========================================================================
179 };
180} /* namespace gum */
181
183
184#endif // GUM_MDD_OPERATOR_STRATEGY_H
Headers of the Operator Strategy interface.
Class to handle efficiently argMaxSet.
Definition argMaxSet.h:78
Base class for discrete random variable.
This class is used to implement factored decision process.
Definition fmdp.h:75
<agrum/FMDP/SDyna/IOperatorStrategy.h>
~MDDOperatorStrategy() override
Default destructor.
MultiDimFunctionGraph< ArgMaxSet< GUM_ELEMENT, Idx >, SetTerminalNodePolicy > * getArgMaxFunctionInstance() override
const DiscreteVariable * lastVar_(const MultiDimFunctionGraph< GUM_ELEMENT > *function)
Returns the last var in the var order for given graph function Called by the evalQaction.
bool shouldEleminateVar_(const DiscreteVariable *v, const FMDP< GUM_ELEMENT > *fmdp)
Indicates if whether or not given var is to be eliminated. Called by the evalQaction.
MultiDimFunctionGraph< ActionSet, SetTerminalNodePolicy > * getAggregatorInstance() override
MultiDimFunctionGraph< GUM_ELEMENT > * regress(const MultiDimFunctionGraph< GUM_ELEMENT > *Vold, Idx actionId, const FMDP< GUM_ELEMENT > *fmdp, const gum::VariableSet &elVarSeq) override
Computes Qaction for given actionid.
MultiDimFunctionGraph< GUM_ELEMENT > * minimize(const MultiDimFunctionGraph< GUM_ELEMENT > *f1, const MultiDimFunctionGraph< GUM_ELEMENT > *f2, Idx del=3) override
MultiDimFunctionGraph< GUM_ELEMENT > * maximize(const MultiDimFunctionGraph< GUM_ELEMENT > *f1, const MultiDimFunctionGraph< GUM_ELEMENT > *f2, Idx del=3) override
MultiDimFunctionGraph< ArgMaxSet< GUM_ELEMENT, Idx >, SetTerminalNodePolicy > * argmaximize(const MultiDimFunctionGraph< ArgMaxSet< GUM_ELEMENT, Idx >, SetTerminalNodePolicy > *f1, const MultiDimFunctionGraph< ArgMaxSet< GUM_ELEMENT, Idx >, SetTerminalNodePolicy > *f2, Idx del=3) override
MultiDimFunctionGraph< GUM_ELEMENT > * subtract(const MultiDimFunctionGraph< GUM_ELEMENT > *f1, const MultiDimFunctionGraph< GUM_ELEMENT > *f2, Idx del=0) override
Subtract current VFunction from old VFunction to see if threshold is reached or not.
MultiDimFunctionGraph< GUM_ELEMENT > * multiply(const MultiDimFunctionGraph< GUM_ELEMENT > *f1, const MultiDimFunctionGraph< GUM_ELEMENT > *f2, Idx del=3) override
MultiDimFunctionGraph< GUM_ELEMENT > * add(const MultiDimFunctionGraph< GUM_ELEMENT > *f1, const MultiDimFunctionGraph< GUM_ELEMENT > *f2, Idx del=1) override
Adds reward to given function( whether a qAction or vFunction).
MultiDimFunctionGraph< GUM_ELEMENT, ExactTerminalNodePolicy > * getFunctionInstance() override
MDDOperatorStrategy()
Default constructor.
Implementation of a Terminal Node Policy that maps nodeid to a set of value.
Size Idx
Type for indexes.
Definition types.h:79
Template implementation of FMDP/planning/MDDOperatorStrategy.h classes.
gum is the global namespace for all aGrUM entities
Definition agrum.h:46
Set< const DiscreteVariable * > VariableSet