aGrUM 3.0.0
a C++ library for (probabilistic) graphical models
gum::BIFXMLIDWriter< GUM_SCALAR > Class Template Reference

Writes an influence diagram in a XML files with BIF format. More...

#include <BIFXMLIDWriter.h>

Inheritance diagram for gum::BIFXMLIDWriter< GUM_SCALAR >:
Collaboration diagram for gum::BIFXMLIDWriter< GUM_SCALAR >:

Public Member Functions

virtual void write (std::ostream &output, const InfluenceDiagram< GUM_SCALAR > &infdiag)
 Writes an influence diagram in the given output stream.
virtual void write (std::string_view filePath, const InfluenceDiagram< GUM_SCALAR > &infdiag)
 Writes an Influence Diagram in the file referenced by filePath.
virtual void write (std::string_view filePath, InfluenceDiagram< GUM_SCALAR > &infdiag)
 Writes an Influence Diagram in the file referenced by filePath, updating metadata (software, creation, lastModification) before writing.
Constructor & destructor
 BIFXMLIDWriter ()
 Default constructor.
virtual ~BIFXMLIDWriter ()
 Destructor.

Private Member Functions

std::string _heading_ ()
 Returns the header of the BIF file.
std::string _documentend_ ()
 Returns the end of the BIF file.
std::string _variableBloc_ (const DiscreteVariable &var, int nodeType)
 Returns a bloc defining a variable in the BIF format.
std::string _variableDefinition_ (const NodeId &varNodeId, const InfluenceDiagram< GUM_SCALAR > &infdiag)
 Returns a bloc defining a variable's table (if she has) in the BIF format.

Detailed Description

template<GUM_Numeric GUM_SCALAR>
class gum::BIFXMLIDWriter< GUM_SCALAR >

Writes an influence diagram in a XML files with BIF format.

This class export an influence diagram 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 BIFXMLIDWriter.h.

Constructor & Destructor Documentation

◆ BIFXMLIDWriter()

template<GUM_Numeric GUM_SCALAR>
gum::BIFXMLIDWriter< GUM_SCALAR >::BIFXMLIDWriter ( )

Default constructor.

◆ ~BIFXMLIDWriter()

template<GUM_Numeric GUM_SCALAR>
virtual gum::BIFXMLIDWriter< GUM_SCALAR >::~BIFXMLIDWriter ( )
virtual

Destructor.

Member Function Documentation

◆ _documentend_()

template<GUM_Numeric GUM_SCALAR>
std::string gum::BIFXMLIDWriter< GUM_SCALAR >::_documentend_ ( )
private

Returns the end of the BIF file.

◆ _heading_()

template<GUM_Numeric GUM_SCALAR>
std::string gum::BIFXMLIDWriter< GUM_SCALAR >::_heading_ ( )
private

Returns the header of the BIF file.

◆ _variableBloc_()

template<GUM_Numeric GUM_SCALAR>
std::string gum::BIFXMLIDWriter< GUM_SCALAR >::_variableBloc_ ( const DiscreteVariable & var,
int nodeType )
private

Returns a bloc defining a variable in the BIF format.

◆ _variableDefinition_()

template<GUM_Numeric GUM_SCALAR>
std::string gum::BIFXMLIDWriter< GUM_SCALAR >::_variableDefinition_ ( const NodeId & varNodeId,
const InfluenceDiagram< GUM_SCALAR > & infdiag )
private

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

◆ write() [1/3]

template<GUM_Numeric GUM_SCALAR>
virtual void gum::BIFXMLIDWriter< GUM_SCALAR >::write ( std::ostream & output,
const InfluenceDiagram< GUM_SCALAR > & infdiag )
virtual

Writes an influence diagram in the given output stream.

Parameters
outputThe output stream.
infdiagThe influence diagram written to the stream.
Exceptions
IOErrorRaised if an I/O error occurs.

Implements gum::IDWriter< GUM_SCALAR >.

◆ write() [2/3]

template<GUM_Numeric GUM_SCALAR>
virtual void gum::BIFXMLIDWriter< GUM_SCALAR >::write ( std::string_view filePath,
const InfluenceDiagram< GUM_SCALAR > & infdiag )
virtual

Writes an Influence Diagram 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 Influence Diagram.
infdiagThe Influence Diagram written to the file.
Exceptions
IOErrorRaised if an I/O error occurs.

Implements gum::IDWriter< GUM_SCALAR >.

◆ write() [3/3]

template<GUM_Numeric GUM_SCALAR>
virtual void gum::IDWriter< GUM_SCALAR >::write ( std::string_view filePath,
InfluenceDiagram< GUM_SCALAR > & infdiag )
virtualinherited

Writes an Influence Diagram in the file referenced by filePath, updating metadata (software, creation, lastModification) before writing.

If the file doesn't exists, it is created. If the file exists, it's content will be erased.

Default implementation delegates to the const overload.

Parameters
filePathThe path to the file used to write the Influence Diagram.
infdiagThe Influence Diagram written to the file (non-const to allow metadata update).
Exceptions
IOErrorRaised if an I/O error occurs.

Reimplemented in gum::GumIDWriter< GUM_SCALAR >.


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