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

Constant decision rule. More...

#include <DecisionRule.hpp>

Inheritance diagram for ConstantDecisionRule:
Collaboration diagram for ConstantDecisionRule:

Public Member Functions

 ConstantDecisionRule (uint memory=1000)
 Constructor of the ConstantDecisionRule class. More...
 
 ~ConstantDecisionRule ()
 Destructor of the ConstantDecisionRule class. More...
 
void createTranslationMap (const dvContainer &tmpContainer, map< string, ROCPPVarIF_Ptr > &translationMap, vector< ROCPPConstraintIF_Ptr > &toAdd)
 Create translation map for the variables in the given container. More...
 
void printOut (const ROCPPOptModelIF_Ptr pIn, const map< string, double > &variableValue, ROCPPVarIF_Ptr dv)
 Print the solution of the given decision variable. More...
 
void printOut (const ROCPPOptModelIF_Ptr pIn, const map< string, double > &resultIn, ROCPPUnc_Ptr unc)
 
ROCPPOptModelIF_Ptr approximate (ROCPPOptModelIF_Ptr pIn)
 
ROCPPOptModelIF_Ptr Reformulate (ROCPPOptModelIF_Ptr pIn)
 
bool isApplicable (ROCPPOptModelIF_Ptr pIn) const
 
string getName () const
 
- Public Member Functions inherited from DiscreteVarsDRIF
 DiscreteVarsDRIF (uint memory=1000)
 Constructor of the DiscreteVarsDRIF class. More...
 
virtual ~DiscreteVarsDRIF ()
 Destructor of the DiscreteVarsDRIF class. More...
 
void findVarsToTranslate (vector< ROCPPConstraintIF_Ptr >::const_iterator first, vector< ROCPPConstraintIF_Ptr >::const_iterator last, ROCPPObjectiveIF_Ptr obj, dvContainer &container)
 Find all adaptive binary and integer variable in the given constraints and objective. More...
 
- Public Member Functions inherited from OneToOneVariableConverterIF
 OneToOneVariableConverterIF ()
 Constructor of OneToOneVariableConverterIF class. More...
 
 ~OneToOneVariableConverterIF ()
 Destructor of OneToOneVariableConverterIF class. More...
 
const_iterator find (string varName) const
 
const_iterator begin () const
 
const_iterator end () const
 
void convertVar (vector< ROCPPConstraintIF_Ptr >::const_iterator first, vector< ROCPPConstraintIF_Ptr >::const_iterator last, ROCPPObjectiveIF_Ptr obj, const dvContainer &origDVContainer, vector< ROCPPConstraintIF_Ptr > &toAdd, ROCPPObjectiveIF_Ptr &toSet, bool resetAndSave=false)
 Approximate the original variable with a new variable or a constant for all variables in the input model. More...
 
void createInverseMap (const dvContainer &origDVContainer)
 Create the map m_inverseMap. More...
 
double evaluateVariableValue (string nme, const map< string, double > &binValuesMap) const
 Evaluate and return the value of the given variable after converting it. More...
 
virtual ROCPPOptModelIF_Ptr convertVar (ROCPPOptModelIF_Ptr pIn, bool resetAndSave=false)
 Get the objective and constraints in the input model and then convert the variables. More...
 
virtual void convertVar (vector< ROCPPConstraintIF_Ptr >::const_iterator first, vector< ROCPPConstraintIF_Ptr >::const_iterator last, ROCPPObjectiveIF_Ptr obj, const dvContainer &origDVContainer, vector< ROCPPConstraintIF_Ptr > &toAdd, ROCPPObjectiveIF_Ptr &toSet, bool resetAndSave=false)=0
 Approximate each variable in the given objective and contraints. More...
 
- Public Member Functions inherited from VariableConverterIF
 VariableConverterIF ()
 Constructor of VariableConverterIF class. More...
 
 ~VariableConverterIF ()
 Destructor of VariableConverterIF class. More...
 
const_iterator_inv findInv (string varName) const
 Return a constant iterator pointing to the pair of the given variable and the old variable associated with it. More...
 
const_iterator_inv beginInv () const
 Return a constant iterator pointing to the beginning of the inverse map (m_inverseMap) More...
 
const_iterator_inv endInv () const
 Return a constant iterator pointing to the end of the inverse map (m_inverseMap) More...
 
virtual ROCPPOptModelIF_Ptr convertVar (ROCPPOptModelIF_Ptr pIn, bool resetAndSave=false)
 Get the objective and constraints in the input model and then convert the variables. More...
 
virtual void convertVar (vector< ROCPPConstraintIF_Ptr >::const_iterator first, vector< ROCPPConstraintIF_Ptr >::const_iterator last, ROCPPObjectiveIF_Ptr obj, const dvContainer &origDVContainer, vector< ROCPPConstraintIF_Ptr > &toAdd, ROCPPObjectiveIF_Ptr &toSet, bool resetAndSave=false)=0
 Approximate each variable in the given objective and contraints. More...
 
virtual void findVarsToTranslate (vector< ROCPPConstraintIF_Ptr >::const_iterator first, vector< ROCPPConstraintIF_Ptr >::const_iterator last, ROCPPObjectiveIF_Ptr obj, dvContainer &container)=0
 Find the variable in the given ocnstraints and objective to be mapped and store them in the container. More...
 
- Public Member Functions inherited from ReformulationStrategyIF
 ReformulationStrategyIF ()
 
 ~ReformulationStrategyIF ()
 

Additional Inherited Members

- Public Types inherited from OneToOneVariableConverterIF
typedef map< string, ROCPPVarIF_Ptr >::const_iterator const_iterator
 
- Public Types inherited from VariableConverterIF
typedef map< string, ROCPPVarIF_Ptr >::const_iterator const_iterator_inv
 Constant iterator into inverse map. More...
 
- Protected Attributes inherited from OneToOneVariableConverterIF
map< string, ROCPPVarIF_Ptrm_translationMap
 Map from name of the original variable to the new variable. More...
 
- Protected Attributes inherited from VariableConverterIF
map< string, ROCPPVarIF_Ptrm_inverseMap
 Map from the new variable name to old variable. More...
 

Detailed Description

Constant decision rule.

Class for approximating discrete variables with an expression that is constant in the uncertain parameters

Constructor & Destructor Documentation

◆ ConstantDecisionRule()

ConstantDecisionRule::ConstantDecisionRule ( uint  memory = 1000)
inline

Constructor of the ConstantDecisionRule class.

◆ ~ConstantDecisionRule()

ConstantDecisionRule::~ConstantDecisionRule ( )
inline

Destructor of the ConstantDecisionRule class.

Member Function Documentation

◆ approximate()

ROCPPOptModelIF_Ptr ConstantDecisionRule::approximate ( ROCPPOptModelIF_Ptr  pIn)
virtual

Implements DecisionRuleIF.

◆ createTranslationMap()

void ConstantDecisionRule::createTranslationMap ( const dvContainer tmpContainer,
map< string, ROCPPVarIF_Ptr > &  translationMap,
vector< ROCPPConstraintIF_Ptr > &  toAdd 
)
virtual

Create translation map for the variables in the given container.

Parameters
tmpContainerContainer contains variables to be mapped
translationMapMap from the name of the variable to the new variable it will be mapped to
toAddContains the upper and lower bounds of the original variables as constraints

Implements OneToOneVariableConverterIF.

◆ getName()

string ConstantDecisionRule::getName ( ) const
inlinevirtual

◆ isApplicable()

bool ConstantDecisionRule::isApplicable ( ROCPPOptModelIF_Ptr  pIn) const
virtual

◆ printOut() [1/2]

void ConstantDecisionRule::printOut ( const ROCPPOptModelIF_Ptr  pIn,
const map< string, double > &  resultIn,
ROCPPUnc_Ptr  unc 
)

◆ printOut() [2/2]

void ConstantDecisionRule::printOut ( const ROCPPOptModelIF_Ptr  pIn,
const map< string, double > &  variableValue,
ROCPPVarIF_Ptr  dv 
)
virtual

Print the solution of the given decision variable.

Reimplemented from VariableConverterIF.

◆ Reformulate()

ROCPPOptModelIF_Ptr ConstantDecisionRule::Reformulate ( ROCPPOptModelIF_Ptr  pIn)
inlinevirtual