aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
ILearningStrategy.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
49
50
51// =========================================================================
52#ifndef GUM_SDYNA_LEARNING_STRATEGY_H
53#define GUM_SDYNA_LEARNING_STRATEGY_H
54// =========================================================================
55#include <string>
56// =========================================================================
57// =========================================================================
58#include <agrum/FMDP/fmdp.h>
61
62// =========================================================================
63// =========================================================================
64
65namespace gum {
66
75 // ###################################################################
77 // ###################################################################
79
80 public:
81 // ==========================================================================
83 // ==========================================================================
84 virtual ~ILearningStrategy() {}
85
87
88 // ###################################################################
90 // ###################################################################
92
93 public:
94 // ==========================================================================
96 // ==========================================================================
97 virtual void initialize(FMDP< double >* fmdp) = 0;
98
100
101
102 // ###################################################################
104 // ###################################################################
106
107 public:
108 // ==========================================================================
116 // ==========================================================================
117 virtual bool addObservation(Idx actionId, const Observation* obs) = 0;
118
119
120 // ==========================================================================
124 // ==========================================================================
125 virtual void updateFMDP() = 0;
126
128
129
130 // ###################################################################
132 // ###################################################################
134
135 public:
136 // ==========================================================================
141 // ==========================================================================
142 virtual Size size() = 0;
143
144 // ==========================================================================
149 // ==========================================================================
150 virtual const IVisitableGraphLearner* varLearner(Idx actionId,
151 const DiscreteVariable* var) const
152 = 0;
153
154 virtual double rMax() const = 0;
155 virtual double modaMax() const = 0;
156
158 };
159} // namespace gum
160#endif // GUM_SDYNA_LEARNING_STRATEGY_H
Headers of the Learning Strategy interface.
Base class for discrete random variable.
<agrum/FMDP/SDyna/ILearningStrategy.h>
virtual const IVisitableGraphLearner * varLearner(Idx actionId, const DiscreteVariable *var) const =0
Required for RMax.
virtual double modaMax() const =0
learnerSize
virtual void initialize(FMDP< double > *fmdp)=0
Initializes the learner.
virtual double rMax() const =0
learnerSize
virtual void updateFMDP()=0
Starts an update of datastructure in the associated FMDP.
virtual Size size()=0
learnerSize
virtual ~ILearningStrategy()
Destructor (virtual and empty since it's an interface).
virtual bool addObservation(Idx actionId, const Observation *obs)=0
Gives to the learner a new transition.
<agrum/FMDP/SDyna/IVisitableGraphLearner.h>
Class for implementation of factored markov decision process.
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
gum is the global namespace for all aGrUM entities
Definition agrum.h:46
Headers of the Observation class.