27 #ifndef GUM_LABELIZED_DISCRETE_VARIABLE_H 28 #define GUM_LABELIZED_DISCRETE_VARIABLE_H 34 #include <agrum/agrum.h> 36 #include <agrum/tools/core/sequence.h> 37 #include <agrum/tools/variables/discreteVariable.h> 51 class LabelizedVariable:
public DiscreteVariable {
64 LabelizedVariable(
const std::string& aName,
65 const std::string& aDesc =
"",
66 const Size nbrLabel = 2);
74 LabelizedVariable(
const std::string& aName,
75 const std::string& aDesc,
76 const std::vector< std::string >& labels);
83 LabelizedVariable(
const LabelizedVariable& aLDRV);
87 virtual ~LabelizedVariable();
90 virtual LabelizedVariable* clone()
const;
101 LabelizedVariable& operator=(
const LabelizedVariable& aLDRV);
108 virtual Idx index(
const std::string& label)
const;
122 bool isLabel(
const std::string& aLabel)
const;
131 LabelizedVariable& addLabel(
const std::string& aLabel);
143 void changeLabel(Idx pos,
const std::string& aLabel)
const;
151 virtual std::string label(Idx i)
const;
154 Idx posLabel(
const std::string& label)
const;
157 virtual double numerical(Idx indice)
const;
160 virtual Size domainSize()
const;
163 virtual VarType varType()
const;
166 virtual const std::string domain()
const;
172 LabelizedVariable() {
173 GUM_CONSTRUCTOR(LabelizedVariable);
179 void copy_(
const LabelizedVariable& aLDRV);
183 mutable Sequence< std::string > _labels_;
197 #ifndef GUM_NO_INLINE 198 # include <agrum/tools/variables/labelizedVariable_inl.h>