![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
<agrum/PRM/o3prm/O3prmBNWriter.h> More...
#include <O3prmBNWriter.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 | |
| O3prmBNWriter () | |
| Default constructor. | |
| ~O3prmBNWriter () override | |
| Destructor. | |
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 | _extractAttribute_ (const IBayesNet< GUM_SCALAR > &bn, NodeId node) |
| std::string | _extractType_ (const IBayesNet< GUM_SCALAR > &bn, NodeId node) |
| template<typename VARTYPE> | |
| std::string | _extractDiscretizedType_ (const VARTYPE *var) |
| std::string | _extractName_ (const IBayesNet< GUM_SCALAR > &bn, NodeId node) |
| std::string | _extractParents_ (const IBayesNet< GUM_SCALAR > &bn, NodeId node) |
| std::string | _extractCPT_ (const IBayesNet< GUM_SCALAR > &bn, NodeId node) |
| std::string | _extractRangeType_ (const IBayesNet< GUM_SCALAR > &bn, NodeId node) |
| std::string | _extractLabelizedType_ (const IBayesNet< GUM_SCALAR > &bn, NodeId node) |
| 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/PRM/o3prm/O3prmBNWriter.h>
Writes an bayes net in a text file with O3PRM format
This class export a bayes net into an text file, using O3PRM format
Definition at line 77 of file O3prmBNWriter.h.
| gum::O3prmBNWriter< GUM_SCALAR >::O3prmBNWriter | ( | ) |
Default constructor.
|
override |
Destructor.
|
protectedinherited |
}
References _buildNameWithOnlyValidChars().
Referenced by _buildNameWithOnlyValidChars().
|
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. |
| bn | The bayes net written in the file. |
| IOError | Raised if an I/O error occurs. |
Implements gum::BNWriter< GUM_SCALAR >.
|
finalprotectedvirtual |
Writes an bayes net in the given ouput stream.
| output | The output stream. |
| bn | The bayes net writen in the stream. |
| IOError | Raised if an I/O error occurs. |
Implements gum::BNWriter< GUM_SCALAR >.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
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().
|
inherited |
References GUM_NODISCARD, and isModificationAllowed().
Referenced by isModificationAllowed().
|
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.