K-adaptability approximator. More...
#include <Kadaptability.hpp>


Public Member Functions | |
| Kadaptability (const map< uint, uint > &numPartitionsMap=map< uint, uint >(), double bigM=100.0, double epsilon=0.0001, string folder=" ") | |
| Constructor of K-Adaptability approximator. More... | |
| ~Kadaptability () | |
| Destructor of K-Adaptability approximator. More... | |
| void | checkWsCompatability (const map< uint, uint > &wsMap) |
| Check the compatability of the given model. More... | |
| void | createVariableAndUncMap (dvContainer::const_iterator varsBegin, dvContainer::const_iterator varsEnd, uncContainer::const_iterator uncBegin, uncContainer::const_iterator uncEnd) |
| Create the map from the original decision variable and uncertainty to the new variable and uncertainty for each plan and pair of partition and time stage respectively. More... | |
| ROCPPOptModelIF_Ptr | approximate (ROCPPOptModelIF_Ptr pIn) |
| Check the compatability of the input model and check whether the model has constraint uncertainty to choose the appropriate method. More... | |
| ROCPPOptModelIF_Ptr | fixSecondStageVariablesToWarmStart (ROCPPOptModelIF_Ptr pIn, ROCPPOptModelIF_Ptr pKadaptModel, const map< string, double > &warmStartResults, const map< uint, uint > &wsMap) |
| Return a new model after fixing second stage variables which are solved by the warm start problem to the value provided in the input map. More... | |
| ROCPPOptModelIF_Ptr | fixBinaryVariableValues (ROCPPOptModelIF_Ptr pKadaptModel, const map< string, bool > &varValues) const |
| Return a new model after fixing second stage variables to the value provided in the input map. More... | |
| virtual ROCPPOptModelIF_Ptr | addProblemSpecificConstraints (ROCPPOptModelIF_Ptr pKadapt) const |
| string | getSolutionApproachParameters (string delimiter) const |
| ROCPPVarIF_Ptr | getDVonPartition (string partition, string OrigDVname) const |
| Get the new variable associated with the given original variable on the given contingency plan. More... | |
| ROCPPUnc_Ptr | getUncOnPartition (string OrigUncName, string partition, uint t) const |
| Get the new uncertain parameter associated with the given original uncertainty on the given contingency plan at time stage t. More... | |
| void | getWsSolutions (ROCPPOptModelIF_Ptr pIn, const map< string, double > &warmStartResults, const map< uint, uint > &wsMap, map< string, double > &wsSolutions) |
| Return the warm start solution of this problem by setting the variables which exist in the warm start problem to their solutions and assigning the variables which don't exist in the warm start problem to the biggest solved kth solutions. More... | |
| void | printParametersToScreen () const |
| void | printOut (const ROCPPOptModelIF_Ptr pIn, const map< string, double > &resultIn, ROCPPVarIF_Ptr dv, string partition) |
| Print out the solution for the given variable for the given plan. More... | |
| void | printOut (const ROCPPOptModelIF_Ptr pIn, const map< string, double > &resultIn, ROCPPVarIF_Ptr dv) |
| Print out the solution for the given variable for all plans. More... | |
| void | printOut (const ROCPPOptModelIF_Ptr pIn, const map< string, double > &resultIn, ROCPPUnc_Ptr unc, string partition) |
| Print out whether observe or not the given uncertainty for the given plan. More... | |
| void | printOut (const ROCPPOptModelIF_Ptr pIn, const map< string, double > &resultIn, ROCPPUnc_Ptr unc) |
| Print out whether we observe or not the given uncertainty for all cases. More... | |
| ROCPPOptModelIF_Ptr | Reformulate (ROCPPOptModelIF_Ptr pIn) |
| bool | isApplicable (ROCPPOptModelIF_Ptr pIn) const |
| string | getName () const |
Public Member Functions inherited from DecisionRuleIF | |
| DecisionRuleIF (uint memory=1000) | |
| Constructor of the DecisionRuleIF class. More... | |
| virtual | ~DecisionRuleIF () |
| Destructor of the DecisionRuleIF class. More... | |
| uint | getMemory () const |
Public Member Functions inherited from ReformulationStrategyIF | |
| ReformulationStrategyIF () | |
| ~ReformulationStrategyIF () | |
Protected Member Functions | |
| void | initialize (ROCPPOptModelIF_Ptr pIn) |
| Initialize the class ith the given parameters. More... | |
| ROCPPOptModelIF_Ptr | approxObjUnc (ROCPPOptModelIF_Ptr pIn) |
| Method for multistage model with only objective uncertainty. More... | |
| ROCPPOptModelIF_Ptr | approxCstrUnc (ROCPPOptModelIF_Ptr pIn) |
| Method for two stage model with both objective and constraint uncertainty. More... | |
Protected Attributes | |
| ROCPPKadaptEncoder_Ptr | m_pPartitionEncoder |
| map< string, map< string, ROCPPVarIF_Ptr > > | m_DVmap |
| Map from original decision variable name to partition string to new decision variable. More... | |
| map< string, map< string, ROCPPVarIF_Ptr > > | m_mapPartitionEnc_mapOrigDVtoDVonPartition |
| Map from partition to map from original variable name to new variable on that partition. More... | |
| map< pair< string, uint >, map< string, ROCPPUnc_Ptr > > | m_mapPartitionEncandt_mapOrigUnctoUnconPartition |
| Map from pair of partition and time stage to the map from uncertainty name to the uncertainty on that partition at specific time stage. More... | |
| ROCPPBilinearReform_Ptr | m_pBTR |
| double | m_epsilon |
| Small values used to deal with the infeasible constraint in constraint uncertainty. More... | |
| string | m_folder |
| map< uint, uint > | m_numPartitionsMap |
| Map from time period to value of K for that time-period. More... | |
Protected Attributes inherited from DecisionRuleIF | |
| uint | m_memory |
| Memory of this approximator. More... | |
K-adaptability approximator.
| Kadaptability::Kadaptability | ( | const map< uint, uint > & | numPartitionsMap = map<uint, uint>(), |
| double | bigM = 100.0, |
||
| double | epsilon = 0.0001, |
||
| string | folder = " " |
||
| ) |
Constructor of K-Adaptability approximator.
| numPartitionsMap | Map from time period to value of K for that time-period |
| bigM | Big-M constant value for linearizing the bilinear terms |
| epsilon | Value of epsilon to build the strictly inequality in the constraint uncertainty case |
| folder | Name of the folders where to save the log file |
|
inline |
Destructor of K-Adaptability approximator.
|
inlinevirtual |
|
protected |
Method for two stage model with both objective and constraint uncertainty.
|
virtual |
Check the compatability of the input model and check whether the model has constraint uncertainty to choose the appropriate method.
Implements DecisionRuleIF.
|
protected |
Method for multistage model with only objective uncertainty.
Check the compatability of the given model.
| void Kadaptability::createVariableAndUncMap | ( | dvContainer::const_iterator | varsBegin, |
| dvContainer::const_iterator | varsEnd, | ||
| uncContainer::const_iterator | uncBegin, | ||
| uncContainer::const_iterator | uncEnd | ||
| ) |
Create the map from the original decision variable and uncertainty to the new variable and uncertainty for each plan and pair of partition and time stage respectively.
| ROCPPOptModelIF_Ptr Kadaptability::fixBinaryVariableValues | ( | ROCPPOptModelIF_Ptr | pKadaptModel, |
| const map< string, bool > & | varValues | ||
| ) | const |
Return a new model after fixing second stage variables to the value provided in the input map.
| ROCPPOptModelIF_Ptr Kadaptability::fixSecondStageVariablesToWarmStart | ( | ROCPPOptModelIF_Ptr | pIn, |
| ROCPPOptModelIF_Ptr | pKadaptModel, | ||
| const map< string, double > & | warmStartResults, | ||
| const map< uint, uint > & | wsMap | ||
| ) |
Return a new model after fixing second stage variables which are solved by the warm start problem to the value provided in the input map.
| pIn | Model before approximating |
| pKadaptModel | Model after approximating |
| warmStartResults | Results of the warm start problem |
| wsMap | Map from time stage to number of k in the warm start problem |
| ROCPPVarIF_Ptr Kadaptability::getDVonPartition | ( | string | partition, |
| string | OrigDVname | ||
| ) | const |
Get the new variable associated with the given original variable on the given contingency plan.
|
inlinevirtual |
Implements ReformulationStrategyIF.
| string Kadaptability::getSolutionApproachParameters | ( | string | delimiter | ) | const |
| ROCPPUnc_Ptr Kadaptability::getUncOnPartition | ( | string | OrigUncName, |
| string | partition, | ||
| uint | t | ||
| ) | const |
Get the new uncertain parameter associated with the given original uncertainty on the given contingency plan at time stage t.
| void Kadaptability::getWsSolutions | ( | ROCPPOptModelIF_Ptr | pIn, |
| const map< string, double > & | warmStartResults, | ||
| const map< uint, uint > & | wsMap, | ||
| map< string, double > & | wsSolutions | ||
| ) |
Return the warm start solution of this problem by setting the variables which exist in the warm start problem to their solutions and assigning the variables which don't exist in the warm start problem to the biggest solved kth solutions.
| pIn | Model before approximating |
| warmStartResults | Results of the warm start problem |
| wsMap | Map from time stage to number of k in the warm start problem |
| wsSolutions | Map from variable name to its warm start solution for all variables in the problem to be solved |
|
protected |
Initialize the class ith the given parameters.
|
virtual |
Implements ReformulationStrategyIF.
| void Kadaptability::printOut | ( | const ROCPPOptModelIF_Ptr | pIn, |
| const map< string, double > & | resultIn, | ||
| ROCPPUnc_Ptr | unc | ||
| ) |
Print out whether we observe or not the given uncertainty for all cases.
| void Kadaptability::printOut | ( | const ROCPPOptModelIF_Ptr | pIn, |
| const map< string, double > & | resultIn, | ||
| ROCPPUnc_Ptr | unc, | ||
| string | partition | ||
| ) |
Print out whether observe or not the given uncertainty for the given plan.
| void Kadaptability::printOut | ( | const ROCPPOptModelIF_Ptr | pIn, |
| const map< string, double > & | resultIn, | ||
| ROCPPVarIF_Ptr | dv | ||
| ) |
Print out the solution for the given variable for all plans.
| void Kadaptability::printOut | ( | const ROCPPOptModelIF_Ptr | pIn, |
| const map< string, double > & | resultIn, | ||
| ROCPPVarIF_Ptr | dv, | ||
| string | partition | ||
| ) |
Print out the solution for the given variable for the given plan.
| void Kadaptability::printParametersToScreen | ( | ) | const |
|
inlinevirtual |
Implements ReformulationStrategyIF.
|
protected |
Map from original decision variable name to partition string to new decision variable.
|
protected |
Small values used to deal with the infeasible constraint in constraint uncertainty.
|
protected |
|
protected |
Map from partition to map from original variable name to new variable on that partition.
|
protected |
Map from pair of partition and time stage to the map from uncertainty name to the uncertainty on that partition at specific time stage.
Map from time period to value of K for that time-period.
|
protected |
|
protected |