aGrUM  0.16.0
gum::Variable Class Referenceabstract

Base class for every random variable. More...

#include <variable.h>

+ Inheritance diagram for gum::Variable:

Public Member Functions

Constructors / Destructors
virtual ~Variable ()
 destructor More...
 
virtual Variableclone () const =0
 Copy Factory. More...
 
Operators
Variableoperator= (const Variable &aRV)
 Copy operator. More...
 
virtual bool operator== (const Variable &aRV) const
 equality operator More...
 
virtual bool operator!= (const Variable &aRV) const
 inequality operator More...
 
Accessors / Modifiers
void setName (const std::string &theValue)
 sets the name of the variable More...
 
const std::string & name () const
 returns the name of the variable More...
 
void setDescription (const std::string &theValue) const
 sets the description of the variable More...
 
const std::string & description () const
 returns the description of the variable More...
 
virtual VarType varType () const =0
 returns the type of variable More...
 
virtual const std::string domain () const =0
 string represent the domain of the variable More...
 

Protected Member Functions

 Variable ()
 (protected) Default constructor More...
 
void _copy (const Variable &aRV)
 protected copy More...
 
 Variable (const std::string &aName, const std::string &aDesc)
 constructor More...
 
 Variable (const Variable &aRV)
 copy constructor More...
 

Detailed Description

Base class for every random variable.

Definition at line 66 of file variable.h.

Constructor & Destructor Documentation

◆ ~Variable()

virtual gum::Variable::~Variable ( )
virtual

destructor

◆ Variable() [1/3]

gum::Variable::Variable ( )
inlineprotected

(protected) Default constructor

Definition at line 140 of file variable.h.

140 { GUM_CONSTRUCTOR(Variable); };
Variable()
(protected) Default constructor
Definition: variable.h:140

◆ Variable() [2/3]

gum::Variable::Variable ( const std::string &  aName,
const std::string &  aDesc 
)
protected

constructor

Parameters
aNamename of the variable
aDescdescription of the variable

◆ Variable() [3/3]

gum::Variable::Variable ( const Variable aRV)
protected

copy constructor

Parameters
aRVthe variable we copy

Member Function Documentation

◆ _copy()

void gum::Variable::_copy ( const Variable aRV)
protected

protected copy

Parameters
aRVto be copied

◆ clone()

virtual Variable* gum::Variable::clone ( ) const
pure virtual

◆ description()

const std::string& gum::Variable::description ( ) const

returns the description of the variable

◆ domain()

virtual const std::string gum::Variable::domain ( ) const
pure virtual

◆ name()

const std::string& gum::Variable::name ( ) const

returns the name of the variable

Referenced by gum::BNdistance< GUM_SCALAR >::__checkCompatibility(), gum::prm::PRMFactory< GUM_SCALAR >::__retrieveCommonType(), gum::prm::PRMFactory< GUM_SCALAR >::__retrieveInputs(), gum::BayesNetFactory< GUM_SCALAR >::__setCPTAndParents(), gum::GibbsBNdistance< GUM_SCALAR >::_computeKL(), gum::MultiDimImplementation< std::string >::add(), gum::Instantiation::add(), gum::FMDP< double >::addTransitionForAction(), gum::FMDP< double >::addVariable(), gum::MultiDimICIModel< GUM_SCALAR >::causalWeight(), gum::Instantiation::chgVal(), gum::learning::genericBNLearner::Database::Database(), gum::prm::PRMFactory< GUM_SCALAR >::endDiscreteType(), gum::prm::PRMFactory< GUM_SCALAR >::endDiscretizedType(), gum::FMDPFactory< GUM_SCALAR >::endVariableDeclaration(), gum::BayesNetFactory< GUM_SCALAR >::endVariableDeclaration(), gum::MarkovBlanket::hasSameStructure(), gum::BayesNetFragment< GUM_SCALAR >::nodeId(), gum::StructuredPlaner< double >::optimalPolicy2String(), gum::Estimator< GUM_SCALAR >::posterior(), gum::prm::PRMFormAttribute< GUM_SCALAR >::PRMFormAttribute(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::PRMScalarAttribute(), gum::Instantiation::setValsFrom(), gum::BayesNetFactory< GUM_SCALAR >::setVariable(), gum::BayesNetFactory< GUM_SCALAR >::setVariableValues(), gum::BayesNetFactory< GUM_SCALAR >::setVariableValuesUnchecked(), gum::MarkovBlanket::toDot(), gum::EssentialGraph::toDot(), gum::InfluenceDiagram< GUM_SCALAR >::toDot(), gum::prm::InstanceBayesNet< GUM_SCALAR >::toDot(), gum::prm::ClassBayesNet< GUM_SCALAR >::toDot(), gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >::toDot(), gum::Estimator< GUM_SCALAR >::update(), and gum::MultiDimFunctionGraph< bool, ExactTerminalNodePolicy >::varNodeListe().

◆ operator!=()

virtual bool gum::Variable::operator!= ( const Variable aRV) const
virtual

inequality operator

◆ operator=()

Variable& gum::Variable::operator= ( const Variable aRV)

Copy operator.

Parameters
aRVto be copied
Returns
a const ref to *this

◆ operator==()

virtual bool gum::Variable::operator== ( const Variable aRV) const
virtual

equality operator

◆ setDescription()

void gum::Variable::setDescription ( const std::string &  theValue) const

sets the description of the variable

Warning
since __description is mutable, setDescription() is const
Parameters
theValue

◆ setName()

void gum::Variable::setName ( const std::string &  theValue)

sets the name of the variable

Parameters
theValue

Referenced by gum::prm::PRMSystem< double >::__groundAttr(), gum::prm::PRMType::__updateName(), gum::FMDP< double >::addVariable(), and gum::TaxiSimulator::TaxiSimulator().

+ Here is the caller graph for this function:

◆ varType()

virtual VarType gum::Variable::varType ( ) const
pure virtual

Member Data Documentation

◆ __description

std::string gum::Variable::__description
mutableprivate

the description of the variable since description is not a characteristic of a variable, we allow the description to be changed even in a const reference.

Definition at line 165 of file variable.h.

◆ __name

std::string gum::Variable::__name
private

the name of the variable

Definition at line 160 of file variable.h.


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