aGrUM  0.14.2
maxParentsMCBayesNetGenerator.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_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 2 of the License, or *
8  * (at your option) any later version. *
9  * *
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, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
27 #ifndef GUM_MAX_PARENTS_MC_BAYES_NET_GENERATOR
28 #define GUM_MAX_PARENTS_MC_BAYES_NET_GENERATOR
29 
30 #include <agrum/agrum.h>
31 
32 #include <fstream>
33 #include <iostream>
34 #include <set>
35 #include <vector>
36 
37 #include <sstream>
38 
39 #ifdef HAVE_DIRENT_H
40 # include <dirent.h>
41 #else
42 # include <agrum/core/mvsc/dirent.h>
43 #endif
44 
45 
46 #include <agrum/BN/BayesNet.h>
51 
52 namespace gum {
84  template < typename GUM_SCALAR,
85  template < typename > class ICPTGenerator = SimpleCPTGenerator,
86  template < typename > class ICPTDisturber = SimpleCPTDisturber >
88  : public MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber > {
89  public:
90  // ############################################################################
92  // ############################################################################
94 
116  Size maxArcs,
117  Size maxModality = 2,
118  Size maxParents = 1,
119  Idx iteration = 5000,
120  Idx p = 30,
121  Idx q = 40);
122 
143  Size maxParents = 2,
144  Idx iteration = 5000,
145  Idx p = 30,
146  Idx q = 40);
147 
152 
154 
155  // ############################################################################
157  // ############################################################################
160 
166  Size maxParents() const;
167 
169 
173  void setMaxParents(Size maxParents);
175 
176  protected:
178 
179  private:
185  bool __checkConditions() final;
186  };
187 
188 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
189  extern template class MaxParentsMCBayesNetGenerator< double >;
190 #endif
191 
192 } /*namespace gum*/
193 
195 #endif // MCBAYESNETGENERATOR
Class representing a Bayesian Network.
Definition: BayesNet.h:76
Abstract class for generating Conditional Probability Tables.
<agrum/BN/generator/SimpleMCayesNetGenerator.h>
Source implementation of MaxParentsMCBayesNetGenerator.
Source implementation of SimpleCPTDisturber.
Idx q() const
Return a constant reference to the probabilité imposed on the Markov Chain BayesNetGenerator.
void setMaxParents(Size maxParents)
Modifies the value of the number of maximum parents imposed on the BayesNetGenerator.
<agrum/BN/generator/MCayesNetGenerator.h>
Class representing Bayesian networks.
Size nbrNodes() const
Return a constant reference to the number of nodes imposed on the IBayesNetGenerator.
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
Size maxArcs() const
Return a constant reference to the maximum number of arcs imposed on the IBayesNetGenerator.
bool __checkConditions() final
function to holding the the specification wanted for the Bayesian markov.
MaxParentsMCBayesNetGenerator(Size nbrNodes, Size maxArcs, Size maxModality=2, Size maxParents=1, Idx iteration=5000, Idx p=30, Idx q=40)
Constructor.
Size maxParents() const
Return a constant reference to the number of maximum parents imposed on the Markov Chain BayesNetGene...
Size Idx
Type for indexes.
Definition: types.h:50
Size iteration() const
Return a constant reference to the number of iteration imposed on the Markov Chain BayesNetGenerator...
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:45
Class for generating bayesian networks.using MC algorithm cf.
Base class for labelized discrete random variables.
Idx p() const
Return a constant reference to the probabilité p imposed on the Markov Chain BayesNetGenerator.
Size maxModality() const
Return a constant reference to the maximum modality imposed on the IBayesNetGenerator.