![]() |
aGrUM
0.16.0
|
Class for discretized random variable. More...
#include <discretizedVariable.h>
Public Member Functions | |
virtual DiscretizedVariable< T_TICKS > * | clone () const |
a virtual clone More... | |
virtual VarType | varType () const |
returns the type of variable More... | |
DiscretizedVariable< T_TICKS > & | operator= (const DiscretizedVariable< T_TICKS > &aDRV) |
operator = More... | |
bool | isTick (const T_TICKS &aTick) const |
DiscretizedVariable & | addTick (const T_TICKS &aTick) |
add a tick. More... | |
void | eraseTicks () |
erase all the Ticks More... | |
virtual std::string | label (Idx i) const |
virtual double | numerical (Idx indice) const |
get a numerical representation of he indice-the value. More... | |
virtual Idx | index (const std::string &label) const |
from the label to its index in var. More... | |
virtual Size | domainSize () const |
virtual const std::string | domain () const |
string represent the domain of the variable More... | |
const T_TICKS & | tick (Idx i) const |
from the index to the tick. More... | |
const std::vector< T_TICKS > & | ticks () const |
Return the list of ticks. More... | |
virtual std::vector< double > | ticksAsDoubles () const |
return the list of ticks as a vector of doubles More... | |
Idx | operator[] (const std::string &label) const |
from the label to its index in var. More... | |
const std::string | toString () const |
string version of *this More... | |
const std::string | toStringWithDescription () const |
string version of *this using description attribute instead of name. More... | |
constructors & destructors | |
DiscretizedVariable (const std::string &aName, const std::string &aDesc) | |
Constructor. More... | |
DiscretizedVariable (const std::string &aName, const std::string &aDesc, const std::vector< T_TICKS > &ticks) | |
Constructor. More... | |
DiscretizedVariable (const DiscretizedVariable< T_TICKS > &aDRV) | |
Copy constructor. More... | |
virtual | ~DiscretizedVariable () |
Destructor. More... | |
Accessors / Modifiers | |
bool | empty () const |
std::vector< std::string > | labels () const |
vector of labels More... | |
Operators | |
virtual bool | operator== (const DiscreteVariable &aRV) const |
equality operator More... | |
virtual bool | operator!= (const DiscreteVariable &aRV) const |
inequality operator More... | |
Operators | |
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... | |
Protected Member Functions | |
void | _copy (const DiscretizedVariable< T_TICKS > &aDRV) |
make a copy TODO since we removed T_OtherData maybe some changes are needed in this method? More... | |
Idx | _dichotomy (const T_TICKS &target, Idx min, Idx max) const |
perform a dichotomy on ticks More... | |
Idx | _pos (const T_TICKS &target) const |
seach the class of target (internally use _dichotomy) More... | |
void | _copy (const Variable &aRV) |
protected copy More... | |
Class for discretized random variable.
a DiscretizedVariable contains a vector of T_TICKS, assuming that the modalities of the variable arc [T1,T2[,[T2,T3[,...,[Tn-1,Tn]. T can be plus_infinity or minus_infinity.
operator [] has a T_TICKS argument.
Definition at line 57 of file discretizedVariable.h.
gum::DiscretizedVariable< T_TICKS >::DiscretizedVariable | ( | const std::string & | aName, |
const std::string & | aDesc | ||
) |
Constructor.
aName | the name |
aDesc | the description |
gum::DiscretizedVariable< T_TICKS >::DiscretizedVariable | ( | const std::string & | aName, |
const std::string & | aDesc, | ||
const std::vector< T_TICKS > & | ticks | ||
) |
Constructor.
aName | the name |
aDesc | the description |
gum::DiscretizedVariable< T_TICKS >::DiscretizedVariable | ( | const DiscretizedVariable< T_TICKS > & | aDRV | ) |
Copy constructor.
aDRV |
|
virtual |
Destructor.
|
protected |
make a copy TODO since we removed T_OtherData maybe some changes are needed in this method?
aDRV | the copied object |
|
protectedinherited |
protected copy
aRV | to be copied |
|
protected |
perform a dichotomy on ticks
target | T_TICKS value |
min | first index |
max | last index |
|
protected |
seach the class of target (internally use _dichotomy)
target |
DiscretizedVariable& gum::DiscretizedVariable< T_TICKS >::addTick | ( | const T_TICKS & | aTick | ) |
add a tick.
aTick |
DefaultInLabel |
Referenced by gum::prm::PRMFactory< GUM_SCALAR >::addTick().
|
virtual |
a virtual clone
Implements gum::IDiscretizedVariable.
|
inherited |
returns the description of the variable
|
virtual |
string represent the domain of the variable
Implements gum::DiscreteVariable.
|
virtual |
Implements gum::DiscreteVariable.
|
inherited |
void gum::DiscretizedVariable< T_TICKS >::eraseTicks | ( | ) |
erase all the Ticks
|
virtual |
bool gum::DiscretizedVariable< T_TICKS >::isTick | ( | const T_TICKS & | aTick | ) | const |
aTick |
|
virtual |
|
inherited |
vector of labels
|
inherited |
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().
|
virtual |
get a numerical representation of he indice-the value.
Implements gum::DiscreteVariable.
inequality operator
|
virtualinherited |
inequality operator
DiscretizedVariable< T_TICKS >& gum::DiscretizedVariable< T_TICKS >::operator= | ( | const DiscretizedVariable< T_TICKS > & | aDRV | ) |
operator =
aDRV | a labelized discrete random variable |
equality operator
|
virtualinherited |
equality operator
|
inlineinherited |
from the label to its index in var.
NotFound |
Definition at line 140 of file discreteVariable.h.
References gum::DiscreteVariable::domain(), gum::DiscreteVariable::index(), gum::DiscreteVariable::label(), gum::DiscreteVariable::toString(), and gum::DiscreteVariable::toStringWithDescription().
|
inherited |
sets the description of the variable
theValue |
|
inherited |
sets the name of the variable
theValue |
Referenced by gum::prm::PRMSystem< double >::__groundAttr(), gum::prm::PRMType::__updateName(), gum::FMDP< double >::addVariable(), and gum::TaxiSimulator::TaxiSimulator().
const T_TICKS& gum::DiscretizedVariable< T_TICKS >::tick | ( | Idx | i | ) | const |
from the index to the tick.
NotFound |
const std::vector< T_TICKS >& gum::DiscretizedVariable< T_TICKS >::ticks | ( | ) | const |
Return the list of ticks.
|
virtual |
return the list of ticks as a vector of doubles
Implements gum::IDiscretizedVariable.
|
inherited |
string version of *this
Referenced by gum::DiscreteVariable::operator[]().
|
inherited |
string version of *this using description attribute instead of name.
Referenced by gum::DiscreteVariable::operator[]().
|
virtual |
returns the type of variable
Implements gum::DiscreteVariable.
|
private |
Definition at line 59 of file discretizedVariable.h.
|
private |
Definition at line 60 of file discretizedVariable.h.