aGrUM  0.14.2
BNLearnerListener.cpp
Go to the documentation of this file.
1 /*
2  <one line to give the program's name and a brief idea of what it does.>
3  Copyright (C) 2012 Pierre-Henri WUILLEMIN <pierre-henri.wuillemin@lip6.fr>
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 s
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
21 
22 namespace gum {
23  namespace learning {
25  ApproximationScheme& sch) :
27  __bnlearner(bnl) {
29  GUM_CONSTRUCTOR(BNLearnerListener);
30  }
31 
34  GUM_CONS_CPY(BNLearnerListener);
35  GUM_ERROR(OperationNotAllowed, "No copy constructor for BNLearnerListener");
36  }
37 
39 
42  GUM_CONS_CPY(BNLearnerListener);
43  GUM_ERROR(OperationNotAllowed, "No copy constructor for BNLearnerListener");
44  }
45 
46  void BNLearnerListener::whenProgress(const void* src,
47  Size pourcent,
48  double error,
49  double time) {
51  static_cast< const ApproximationScheme* >(src), pourcent, error, time);
52  }
53  void BNLearnerListener::whenStop(const void* src, std::string message) {
54  __bnlearner->distributeStop(static_cast< const ApproximationScheme* >(src),
55  message);
56  }
57  } // namespace learning
58 } // namespace gum
INLINE void setCurrentApproximationScheme(const ApproximationScheme *approximationScheme)
{@ /// distribute signals
A class for generic framework of learning algorithms that can easily be used.
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.
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
A listener that allows BNLearner to be used as a proxy for its inner algorithms.
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:45
#define GUM_ERROR(type, msg)
Definition: exceptions.h:52
The ApproximationSchemeListener class.