aGrUM  0.13.2
gum::BIFXMLBNWriter< GUM_SCALAR > Class Template Reference

<agrum/BN/io/BIFXML/BIFXMLBNWriter.h> More...

#include <BIFXMLBNWriter.h>

+ Inheritance diagram for gum::BIFXMLBNWriter< GUM_SCALAR >:
+ Collaboration diagram for gum::BIFXMLBNWriter< GUM_SCALAR >:

Public Member Functions

void write (std::ostream &output, const IBayesNet< GUM_SCALAR > &bn) final
 Writes an bayes net in the given ouput stream. More...
 
void write (const std::string &filePath, const IBayesNet< GUM_SCALAR > &bn) final
 Writes an bayes net in the file referenced by filePath. More...
 
Constructor & destructor
 BIFXMLBNWriter ()
 Default constructor. More...
 
 ~BIFXMLBNWriter () final
 Destructor. More...
 

Detailed Description

template<typename GUM_SCALAR>
class gum::BIFXMLBNWriter< GUM_SCALAR >

<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 57 of file BIFXMLBNWriter.h.

Constructor & Destructor Documentation

template<typename GUM_SCALAR >
gum::BIFXMLBNWriter< GUM_SCALAR >::BIFXMLBNWriter ( )

Default constructor.

template<typename GUM_SCALAR >
gum::BIFXMLBNWriter< GUM_SCALAR >::~BIFXMLBNWriter ( )
final

Destructor.

Member Function Documentation

template<typename GUM_SCALAR >
std::string gum::BIFXMLBNWriter< GUM_SCALAR >::__documentend ( )
private

Returns the end of the BIF file.

template<typename GUM_SCALAR >
std::string gum::BIFXMLBNWriter< GUM_SCALAR >::__heading ( const IBayesNet< GUM_SCALAR > &  bn)
private

Returns the header of the BIF file.

template<typename GUM_SCALAR >
std::string gum::BIFXMLBNWriter< GUM_SCALAR >::__variableBloc ( const DiscreteVariable var)
private

Returns a bloc defining a variable in the BIF format.

template<typename GUM_SCALAR >
std::string gum::BIFXMLBNWriter< GUM_SCALAR >::__variableDefinition ( const NodeId varNodeId,
const IBayesNet< GUM_SCALAR > &  bn 
)
private

Returns a bloc defining a variable's table (if she has) in the BIF format.

template<typename GUM_SCALAR >
void gum::BIFXMLBNWriter< GUM_SCALAR >::write ( std::ostream &  output,
const IBayesNet< GUM_SCALAR > &  bn 
)
finalvirtual

Writes an bayes net in the given ouput stream.

Parameters
outputThe output stream.
infdiagThe bayes net writen in the stream.
Exceptions
IOErrorRaised if an I/O error occurs.

Implements gum::BNWriter< GUM_SCALAR >.

template<typename GUM_SCALAR >
void gum::BIFXMLBNWriter< GUM_SCALAR >::write ( const std::string &  filePath,
const IBayesNet< GUM_SCALAR > &  bn 
)
finalvirtual

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.

Parameters
filePathThe path to the file used to write the bayes net.
infdiagThe bayes net writen in the file.
Exceptions
IOErrorRaised if an I/O error occurs.

Implements gum::BNWriter< GUM_SCALAR >.


The documentation for this class was generated from the following file: