aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
BNLearnerListener.h
Go to the documentation of this file.
1 /**
2  *
3  * Copyright (c) 2005-2021 by Pierre-Henri WUILLEMIN(@LIP6) & Christophe GONZALES(@AMU)
4  * info_at_agrum_dot_org
5  *
6  * This library is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this library. If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 /*
22  <one line to give the program's name and a brief idea of what it does.>
23  Copyright (c) 2012 Pierre-Henri WUILLEMIN(@LIP6)
24  <pierre-henri.wuillemin@lip6.fr>
25 
26  This program is free software: you can redistribute it and/or modify
27  it under the terms of the GNU General Public License as published by
28  the Free Software Foundation, either version 3 of the License, or
29  (at your option) any later version.
30 
31  This program is distributed in the hope that it will be useful,
32  but WITHOUT ANY WARRANTY; without even the implied warranty of
33  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34  GNU General Public License for more details.
35 
36  You should have received a copy of the GNU General Public License
37  along with this program. If not, see <http://www.gnu.org/licenses/>.
38 */
39 
40 /**
41  * @file
42  * @brief A listener that allows BNLearner to be used as a proxy for its inner
43  * algorithms
44  *
45  * @author Pierre-Henri WUILLEMIN(@LIP6) & Christophe GONZALES(@AMU)
46  */
47 #ifndef BNLEARNERLISTENER_H
48 #define BNLEARNERLISTENER_H
49 
50 #include <agrum/agrum.h>
51 #include <agrum/tools/core/approximations/approximationScheme.h>
52 #include <agrum/tools/core/approximations/approximationSchemeListener.h>
53 
54 namespace gum {
55  namespace learning {
56  class genericBNLearner;
57 
58  /** @class BNLearnerListener
59  * @brief A class that redirects gum_signal from algorithms to the listeners
60  *of
61  *BNLearn
62  *
63  * @ingroup learning_group
64  */
66  public:
67  BNLearnerListener(genericBNLearner* bnl, ApproximationScheme& sch);
68  virtual ~BNLearnerListener();
69 
70  virtual void whenProgress(const void* src,
71  const Size pourcent,
72  const double error,
73  const double time) final;
74  virtual void whenStop(const void* src, const std::string message) final;
75 
76  private:
79 
80  genericBNLearner* _bnlearner_;
81  };
82  } // namespace learning
83 } // namespace gum
84 
85 #endif // BNLEARNERLISTENER_H
BNLearnerListener(const BNLearnerListener &other)
BNLearnerListener & operator=(const BNLearnerListener &other)
INLINE void emplace(Args &&... args)
Definition: set_tpl.h:643
A class that redirects gum_signal from algorithms to the listeners of BNLearn.
BNLearnerListener(genericBNLearner *bnl, ApproximationScheme &sch)
virtual void whenStop(const void *src, const std::string message) final
When it stops.
virtual void whenProgress(const void *src, const Size pourcent, const double error, const double time) final
When progress was made.
Database(const std::string &filename, const BayesNet< GUM_SCALAR > &bn, const std::vector< std::string > &missing_symbols)