aGrUM  0.16.0
BNLearnerListener.cpp
Go to the documentation of this file.
1 
22 /*
23  <one line to give the program's name and a brief idea of what it does.>
24  Copyright (C) 2012 Pierre-Henri WUILLEMIN <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 s
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 
42 
43 namespace gum {
44  namespace learning {
46  ApproximationScheme& sch) :
48  __bnlearner(bnl) {
50  GUM_CONSTRUCTOR(BNLearnerListener);
51  }
52 
55  GUM_CONS_CPY(BNLearnerListener);
56  GUM_ERROR(OperationNotAllowed, "No copy constructor for BNLearnerListener");
57  }
58 
60 
63  GUM_CONS_CPY(BNLearnerListener);
64  GUM_ERROR(OperationNotAllowed, "No copy constructor for BNLearnerListener");
65  }
66 
67  void BNLearnerListener::whenProgress(const void* src,
68  Size pourcent,
69  double error,
70  double time) {
72  static_cast< const ApproximationScheme* >(src), pourcent, error, time);
73  }
74  void BNLearnerListener::whenStop(const void* src, std::string message) {
75  __bnlearner->distributeStop(static_cast< const ApproximationScheme* >(src),
76  message);
77  }
78  } // namespace learning
79 } // namespace gum
INLINE void setCurrentApproximationScheme(const ApproximationScheme *approximationScheme)
{@ /// distribute signals
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
BNLearnerListener & operator=(const BNLearnerListener &other)
Approximation Scheme.
INLINE void distributeStop(const ApproximationScheme *approximationScheme, std::string message)
distribute signals
INLINE void distributeProgress(const ApproximationScheme *approximationScheme, Size pourcent, double error, double time)
{@ /// distribute signals
A class that redirects gum_signal from algorithms to the listeners of BNLearn.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
BNLearnerListener(genericBNLearner *bnl, ApproximationScheme &sch)
virtual void whenStop(const void *src, const std::string message) final
When it stops.
A pack of learning algorithms that can easily be used.
virtual void whenProgress(const void *src, const Size pourcent, const double error, const double time) final
When progress was made.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:48
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55
The ApproximationSchemeListener class.