aGrUM  0.13.2
IBayesNetGenerator.h
Go to the documentation of this file.
1 
2 /***************************************************************************
3  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
4  * {prenom.nom}_at_lip6.fr *
5  * *
6  * This program is free software; you can redistribute it and/or modify *
7  * it under the terms of the GNU General Public License as published by *
8  * the Free Software Foundation; either version 2 of the License, or *
9  * (at your option) any later version. *
10  * *
11  * This program 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 General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License *
17  * along with this program; if not, write to the *
18  * Free Software Foundation, Inc., *
19  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
20  ***************************************************************************/
27 #ifndef GUM_I_BAYES_NET_GENERATOR_H
28 #define GUM_I_BAYES_NET_GENERATOR_H
29 
30 #include <climits>
31 #include <cstdio>
32 #include <cstdlib>
33 #include <iostream>
34 #include <vector>
35 
36 #include <agrum/BN/BayesNet.h>
38 #include <agrum/agrum.h>
39 
41 
43 
44 namespace gum {
45 
60  template < typename GUM_SCALAR, template < typename > class ICPTGenerator >
61  class IBayesNetGenerator : public ICPTGenerator< GUM_SCALAR > {
62  public:
63  // ############################################################################
65  // ############################################################################
67 
81 
86  virtual ~IBayesNetGenerator();
88 
89  // ############################################################################
91  // ############################################################################
93 
100  virtual void generateBN(BayesNet< GUM_SCALAR >& bayesNet) = 0;
101 
109  void fillCPT();
110 
112  // ===========================================================================
114  // ===========================================================================
116 
124  Size nbrNodes() const;
125 
130  Size maxArcs() const;
131 
136  Size maxModality() const;
137 
142  // void setcptGenerator(CPTGenerator * cptGenerator);
146  void setNbrNodes(Size nbrNodes);
147 
151  void setMaxArcs(Size maxArcs);
152 
156  void setMaxModality(Size maxModality);
157 
159  protected:
160  // The Conditional Probability Table generator
161  // CPTGenerator * _cptGenerator;
166  };
167 
168 } /* namespace gum */
169 
171 
172 #endif /* GUM_I_BAYES_NET_GENERATOR_H */
algorithm for KL divergence between BNs
Class representing a Bayesian Network.
Definition: BayesNet.h:76
unsigned long Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:50
Size maxModality() const
Return a constant reference to the maximum modality imposed on the IBayesNetGenerator.
Abstract class for generating Conditional Probability Tables.
void fillCPT()
function that insert random values in the CPT of each nodes according to the CPTGenerator.
Class for generating bayesian networks.
IBayesNetGenerator(Size nbrNodes, Size maxArcs, Size maxModality)
constructor.
void setNbrNodes(Size nbrNodes)
Modifies the value of the number of nodes imposed on the BayesGenerator.
Class representing Bayesian networks.
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
void setMaxArcs(Size maxArcs)
Modifies the value of the number of nodes imposed on the BayesGenerator.
Size nbrNodes() const
Return a constant reference to the number of nodes imposed on the IBayesNetGenerator.
Source implementation of IBayesNetGenerator.
BayesNet< GUM_SCALAR > _bayesNet
Size maxArcs() const
Return a constant reference to the maximum number of arcs imposed on the IBayesNetGenerator.
virtual ~IBayesNetGenerator()
Destructor.
virtual void generateBN(BayesNet< GUM_SCALAR > &bayesNet)=0
Virtual function that Generates a bayesian networks.
Base class for labelized discrete random variables.
void setMaxModality(Size maxModality)
Modifies the value of the number of nodes imposed on the BayesGenerator.