ROC++  v1.2
Automatic Robust Optimization in C++
VariableBool Class Reference

Static boolean variable. More...

#include <DecisionVariable.hpp>

Inheritance diagram for VariableBool:
Collaboration diagram for VariableBool:

Public Member Functions

 VariableBool (string name, double lb=0., double ub=1.0)
 Constructor of the VariableBool class. More...
 
 ~VariableBool ()
 Destructor of the VariableBool class. More...
 
bool isBooleanVar () const
 Always returns true for VariableBool. More...
 
bool isIntegerVar () const
 Return true if and only if the decision variable is of integer type. More...
 
bool isRealVar () const
 Return true if and only if the decision variable is of real-valued type. More...
 
void setLB (double lb)
 Set lower bound of the boolean variable. More...
 
void setUB (double ub)
 Set upper bound of the boolean variable. More...
 
ROCPPVarIF_Ptr Clone ()
 Return a copy of the decision variable. More...
 
- Public Member Functions inherited from VariableIF
 VariableIF (string name, decVariableType type, double lb, double ub)
 Constructor of the VariableIF class. More...
 
virtual ~VariableIF ()
 Destructor of the VariableIF class. More...
 
bool isAdaptive () const
 Return indicator of adaptability, return value equals true if and only if the decision variable can adapt to the history of observations. More...
 
uint getTimeStage () const
 Return the time-stage when the decision is made. More...
 
- Public Member Functions inherited from DecisionVariableIF
 DecisionVariableIF (string name, decVariableType type, double lb, double ub)
 Constructor of the DecisionVariableIF class. More...
 
virtual ~DecisionVariableIF ()
 Destructor of the DecisionVariableIF class. More...
 
decVariableType getType () const
 Get the variable type. More...
 
string getName () const
 Return the name of the decision variable. More...
 
double getLB () const
 Return the lower bound of the decision variable. More...
 
double getUB () const
 Return the upper bound of the decision variable. More...
 
string writeLB () const
 Return the lower bound of the decision variable as a string. More...
 
string writeUB () const
 Return the upper bound of the decision variable as a string. More...
 

Detailed Description

Static boolean variable.

Constructor & Destructor Documentation

◆ VariableBool()

VariableBool::VariableBool ( string  name,
double  lb = 0.,
double  ub = 1.0 
)

Constructor of the VariableBool class.

◆ ~VariableBool()

VariableBool::~VariableBool ( )
inline

Destructor of the VariableBool class.

Member Function Documentation

◆ Clone()

ROCPPVarIF_Ptr VariableBool::Clone ( )
virtual

Return a copy of the decision variable.

Implements DecisionVariableIF.

◆ isBooleanVar()

bool VariableBool::isBooleanVar ( ) const
inlinevirtual

Always returns true for VariableBool.

Implements DecisionVariableIF.

◆ isIntegerVar()

bool VariableBool::isIntegerVar ( ) const
inlinevirtual

Return true if and only if the decision variable is of integer type.

Implements DecisionVariableIF.

◆ isRealVar()

bool VariableBool::isRealVar ( ) const
inlinevirtual

Return true if and only if the decision variable is of real-valued type.

Implements DecisionVariableIF.

◆ setLB()

void VariableBool::setLB ( double  lb)
virtual

Set lower bound of the boolean variable.

If the input value is greater than 0.0, then the lower bound will be set to 1.0, else it will be set to 0.0

Reimplemented from DecisionVariableIF.

◆ setUB()

void VariableBool::setUB ( double  ub)
virtual

Set upper bound of the boolean variable.

If the input value less than 1.0, then the upper bound will be set to 0.0, else it will be set to 1.0

Reimplemented from DecisionVariableIF.