![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
<agrum/BN/io/BIFXML/BIFXMLBNWriter.h> More...
#include <BIFXMLBNWriter.h>
Public Member Functions | |
| void | write (std::ostream &output, const IBayesNet< GUM_SCALAR > &bn) |
| Writes a Bayesian network in the output stream. | |
| void | write (const std::string &filePath, const IBayesNet< GUM_SCALAR > &bn) |
| Writes a Bayesian network in the file referenced by filePath. | |
| GUM_NODISCARD bool | isModificationAllowed () const |
| void | setAllowModification (bool am) |
Constructor & destructor | |
| BIFXMLBNWriter () | |
| Default constructor. | |
| ~BIFXMLBNWriter () override | |
| Destructor. | |
| BIFXMLBNWriter (const BIFXMLBNWriter &)=default | |
| Default constructor. | |
| BIFXMLBNWriter (BIFXMLBNWriter &&) noexcept=default | |
| Default constructor. | |
| BIFXMLBNWriter & | operator= (const BIFXMLBNWriter &)=default |
| Default constructor. | |
| BIFXMLBNWriter & | operator= (BIFXMLBNWriter &&) noexcept=default |
| Default constructor. | |
Protected Member Functions | |
| void | _doWrite (std::ostream &output, const IBayesNet< GUM_SCALAR > &bn) final |
| Writes an bayes net in the given ouput stream. | |
| void | _doWrite (const std::string &filePath, const IBayesNet< GUM_SCALAR > &bn) final |
| Writes an bayes net in the file referenced by filePath. | |
Private Member Functions | |
| std::string | _heading_ (const IBayesNet< GUM_SCALAR > &bn) |
| Returns the header of the BIF file. | |
| std::string | _documentend_ () |
| Returns the end of the BIF file. | |
| std::string | _variableBloc_ (const DiscreteVariable &var) |
| Returns a bloc defining a variable in the BIF format. | |
| std::string | _variableDefinition_ (const NodeId &varNodeId, const IBayesNet< GUM_SCALAR > &bn) |
| Returns a bloc defining a variable's table (if she has) in the BIF format. | |
| virtual void | _syntacticalCheck (const IBayesNet< GUM_SCALAR > &bn) |
| Check whether the BN is syntactically correct for BIF format. | |
| void | _validCharInNamesCheck (const IBayesNet< GUM_SCALAR > &bn) |
| } | |
| std::string | _onlyValidCharsInName (const std::string &name) |
| } | |
| std::string | _buildNameWithOnlyValidChars (const std::string &name) |
| } | |
| bool | _allowModification_ = false |
| } | |
<agrum/BN/io/BIFXML/BIFXMLBNWriter.h>
Writes an bayes net in a XML file with BIF format
This class export a bayes net into an XML files, using BIF format See http://www-2.cs.cmu.edu/afs/cs/user/fgcozman/www/Research/InterchangeFormat/ for information about this format.
Definition at line 81 of file BIFXMLBNWriter.h.
| gum::BIFXMLBNWriter< GUM_SCALAR >::BIFXMLBNWriter | ( | ) |
Default constructor.
Referenced by BIFXMLBNWriter(), BIFXMLBNWriter(), _variableDefinition_(), operator=(), and operator=().
|
override |
Destructor.
|
default |
|
defaultnoexcept |
|
protectedinherited |
}
References _buildNameWithOnlyValidChars().
Referenced by _buildNameWithOnlyValidChars().
|
private |
Returns the end of the BIF file.
References _documentend_().
Referenced by _documentend_().
|
finalprotectedvirtual |
Writes an bayes net in the file referenced by filePath.
If the file doesn't exists, it is created. If the file exists, it's content will be erased.
| filePath | The path to the file used to write the bayes net. |
| infdiag | The bayes net writen in the file. |
| IOError | Raised if an I/O error occurs. |
Implements gum::BNWriter< GUM_SCALAR >.
References _doWrite().
|
finalprotectedvirtual |
Writes an bayes net in the given ouput stream.
| output | The output stream. |
| infdiag | The bayes net writen in the stream. |
| IOError | Raised if an I/O error occurs. |
Implements gum::BNWriter< GUM_SCALAR >.
References _doWrite().
Referenced by _doWrite(), and _doWrite().
|
private |
Returns the header of the BIF file.
References _heading_().
Referenced by _heading_().
|
protectedinherited |
}
References _onlyValidCharsInName().
Referenced by _onlyValidCharsInName().
|
protectedvirtualinherited |
Check whether the BN is syntactically correct for BIF format.
| FatalError | if found. |
Reimplemented in gum::BIFWriter< GUM_SCALAR >, and gum::DSLWriter< GUM_SCALAR >.
References _syntacticalCheck().
Referenced by _syntacticalCheck().
|
protectedinherited |
}
References _validCharInNamesCheck().
Referenced by _validCharInNamesCheck().
|
private |
Returns a bloc defining a variable in the BIF format.
References _variableBloc_().
Referenced by _variableBloc_().
|
private |
Returns a bloc defining a variable's table (if she has) in the BIF format.
References BIFXMLBNWriter(), and _variableDefinition_().
Referenced by _variableDefinition_().
|
inherited |
References GUM_NODISCARD, and isModificationAllowed().
Referenced by isModificationAllowed().
|
defaultnoexcept |
|
default |
|
inherited |
References setAllowModification().
Referenced by setAllowModification().
|
inherited |
Writes a Bayesian network in the file referenced by filePath.
| filePath | The path to the file used to write the Bayesian network. |
| bn | The Bayesian network writen in the file. |
| IOError | Raised if an I/O error occurs. |
References write().
|
inherited |
Writes a Bayesian network in the output stream.
| output | The output stream. |
| bn | The Bayesian network written in output. |
| IOError | Raised if an I/O error occurs. |
| SyntaxError | Raised if syntactical errors in the BN |
References write().
Referenced by gum::credal::CredalNet< GUM_SCALAR >::saveBNsMinMax(), write(), and write().
|
privateinherited |
}
Definition at line 163 of file BNWriter.h.