aGrUM
3.2.0
a C++ library for (probabilistic) graphical models
Toggle main menu visibility
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-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
// =========================================================================
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
>
59
#include <
agrum/FMDP/learning/datastructure/IVisitableGraphLearner.h
>
60
#include <
agrum/FMDP/learning/observation.h
>
61
62
// =========================================================================
63
// =========================================================================
64
65
namespace
gum
{
66
74
class
GUM_PUBLIC_FMDP
ILearningStrategy
{
75
// ###################################################################
77
// ###################################################################
79
80
public
:
81
// ==========================================================================
83
// ==========================================================================
84
virtual
~ILearningStrategy
() =
default
;
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
= 0;
152
153
virtual
double
rMax
()
const
= 0;
154
virtual
double
modaMax
()
const
= 0;
155
157
};
158
}
// namespace gum
159
#endif
// GUM_SDYNA_LEARNING_STRATEGY_H
IVisitableGraphLearner.h
Headers of the Learning Strategy interface.
gum::DiscreteVariable
Base class for discrete random variable.
Definition
discreteVariable.h:80
gum::FMDP< double >
gum::ILearningStrategy
<agrum/FMDP/SDyna/ILearningStrategy.h>
Definition
ILearningStrategy.h:74
gum::ILearningStrategy::varLearner
virtual const IVisitableGraphLearner * varLearner(Idx actionId, const DiscreteVariable *var) const =0
Required for RMax.
gum::ILearningStrategy::modaMax
virtual double modaMax() const =0
learnerSize
gum::ILearningStrategy::initialize
virtual void initialize(FMDP< double > *fmdp)=0
Initializes the learner.
gum::ILearningStrategy::rMax
virtual double rMax() const =0
learnerSize
gum::ILearningStrategy::updateFMDP
virtual void updateFMDP()=0
Starts an update of datastructure in the associated FMDP.
gum::ILearningStrategy::~ILearningStrategy
virtual ~ILearningStrategy()=default
Destructor (virtual and empty since it's an interface).
gum::ILearningStrategy::size
virtual Size size()=0
learnerSize
gum::ILearningStrategy::addObservation
virtual bool addObservation(Idx actionId, const Observation *obs)=0
Gives to the learner a new transition.
gum::IVisitableGraphLearner
<agrum/FMDP/SDyna/IVisitableGraphLearner.h>
Definition
IVisitableGraphLearner.h:71
gum::Observation
Definition
observation.h:73
fmdp.h
Class for implementation of factored markov decision process.
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
gum
gum is the global namespace for all aGrUM entities
Definition
agrum.h:46
observation.h
Headers of the Observation class.
aGrUM
3.2.0
© PHW&CG&others - 2022
DoXyGeN 1.18.0