49#ifndef GUM_RANGE_VARIABLE_H
50#define GUM_RANGE_VARIABLE_H
81 RangeVariable(
const std::string& aName,
const std::string& aDesc);
116 std::string
toFast()
const final;
157 Idx index(
const std::string&)
const final;
174 std::string
domain()
const final;
177 std::string
stype() const final {
return "Range"; };
DiscreteVariable(const std::string &aName, const std::string &aDesc)
Default constructor.
void setMaxVal(long maxVal)
Set a new value of the upper bound.
RangeVariable * clone() const final
Copy Factory.
Idx index(const std::string &) const final
Idx closestIndex(double val) const final
returns the closest index of the value
std::string label(Idx index) const final
Get the index-th label.
long maxVal() const
Returns the upper bound.
long _minBound_
The upper bound.
bool belongs(long val) const
Returns true if the param belongs to the variable's interval.
bool _checkSameDomain_(const Variable &aRV) const final
check the domain
void setMinVal(long minVal)
Set a new value for the lower bound.
Size domainSize() const final
returns the size of the random discrete variable domain
VarType varType() const final
returns the type of variable
std::string toFast() const final
returns the size of the random discrete variable domain
RangeVariable & operator=(const RangeVariable &aRV)
Copy operator.
std::string stype() const final
string represent the type of the variable
double numerical(Idx index) const final
get a numerical representation of the index-the value.
std::string domain() const final
string represent the domain of the variable
RangeVariable(const std::string &aName, const std::string &aDesc, long minVal, long maxVal)
constructors
long minVal() const
Returns the lower bound.
~RangeVariable() final
destructor
long _maxBound_
The upper bound.
Base class for every random variable.
Base class for discrete random variable.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size Idx
Type for indexes.
gum is the global namespace for all aGrUM entities
Inline implementation of gumRangeVariable.