Piecewise constant and piecewise linear decision rule approximator. More...
#include <PWDecisionRule.hpp>


Public Member Functions | |
| PiecewiseDecisionRule (const map< string, uint > &numPartitionsMap=map< string, uint >(), double bigM=100., bool useExplicitNACs=false, string folder=" ") | |
| Constructor of the PiecewiseDecisionRule class. More... | |
| ~PiecewiseDecisionRule () | |
| Constructor of the PiecewiseApproximator class Directly initialize with the predefined private members (for greater customization) More... | |
| ROCPPOptModelIF_Ptr | approximate (ROCPPOptModelIF_Ptr pIn) |
| Approximate the input model First construct the partition maps, then calculate and robustity the model on each subset, finally add non-anticipativity constraints. More... | |
| string | getSolutionApproachParameters (string delimiter) const |
| Return a new model after fixing the binary variables to the value provided in the input map. More... | |
| pair< bool, ROCPPVarIF_Ptr > | findOrigVariable (ROCPPVarIF_Ptr newdv) const |
| Find the variable that new decision variable originated from after LDR and CDR. More... | |
| ROCPPVarIF_Ptr | getVarOnPartition (string partition, string origVarName) const |
| Get the decision variable on the the given subset of the partition for the given original variable. More... | |
| void | calculateSolution (ROCPPOptModelIF_Ptr pIn, const map< string, double > &resultIn, ROCPPVarIF_Ptr dv, string partition) |
| Calculate solution for the given variable on the given subset of the partition. More... | |
| void | calculateSolution (ROCPPOptModelIF_Ptr pIn, const map< string, double > &resultIn, ROCPPUnc_Ptr unc, string partition) |
| Calculate the measurement variable value for the given uncertainty on the given subset of the partition. More... | |
| void | getWsSolutions (ROCPPOptModelIF_Ptr pIn, const map< string, double > &warmStartResults, const map< string, 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 do not exist in the warm start problem to the solutions on the nearest partition. More... | |
| void | printParametersToScreen () const |
| void | printOut (const ROCPPOptModelIF_Ptr pIn, const map< string, double > &resultIn, ROCPPVarIF_Ptr dv, map< ROCPPUnc_Ptr, uint > partitionIn) |
| Print out the solution for the given variable on the given subset of the partition. More... | |
| void | printOut (const ROCPPOptModelIF_Ptr pIn, const map< string, double > &resultIn, ROCPPVarIF_Ptr dv) |
| Print out the solution for the given variable on all subsets of the the partition. More... | |
| void | printOut (const ROCPPOptModelIF_Ptr pIn, const map< string, double > &resultIn, ROCPPUnc_Ptr unc, map< ROCPPUnc_Ptr, uint > partitionIn) |
| Print out whether observe or not the given uncertainty on the given subset of the partition. 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 on all subsets of the partition. 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 () | |
Private Member Functions | |
| void | initialize (ROCPPOptModelIF_Ptr pIn) |
| Initialize the class with the given parameters. More... | |
| void | createVariableMap (ROCPPOptModelIF_Ptr pIn, ROCPPOptModelIF_Ptr pMiddle, vector< ROCPPConstraintIF_Ptr > &vecNACs) |
| Create the map from partition to map from variable in original problem to variable on partition. More... | |
| void | createUncertaintyMap (ROCPPOptModelIF_Ptr pIn) |
| Create the map from partition to map from uncertain parameter in original problem to uncertainty on partition. More... | |
| pair< double, map< string, ROCPPExpr_Ptr > > | calculateMeanAndProb (ROCPPOptModelIF_Ptr pModel, string partition, const map< string, pair< double, double > > &allMap, double allArea) |
| Calculate the probability of the given subset of the partition and the means of the uncertain parameters on it. More... | |
| ROCPPExpr_Ptr | getStochasticObj (const pair< double, map< string, ROCPPExpr_Ptr > > &meanAndProb, const ROCPPObjectiveIF_Ptr oldObj, string partitionSubsetNme) |
| Calculate the value of the objective on the given subset of the partition. More... | |
Private Attributes | |
| string | m_numPartitionsStr |
| String encoding the number of subsets in the partition for every observable uncertainty in the problem, in alphabetical order. More... | |
| ROCPPContinuousVarsDR_Ptr | m_pCVA |
| Linear decision rule converter. More... | |
| ROCPPDiscreteVarsDR_Ptr | m_pDVA |
| Constant decision rule converter. More... | |
| ROCPPMItoMB_Ptr | m_pMItoMB_Bilinear |
| ROCPPUncSetRealVarApprox_Ptr | m_pBPA |
| ROCPPParConstructor_Ptr | m_pPartConstructor |
| Partition constructor of this approximator. More... | |
| ROCPPParConverter_Ptr | m_pPartConverter |
| Partition converter of this approximator. More... | |
| map< string, map< string, ROCPPVarIF_Ptr > > | m_VariableMap |
| Map from subset of partition to map from variable in original problem to variable on subset of the partition. More... | |
| bool | m_useExplicitNACs |
| Use constraints to describe the non anticipativity constraints. More... | |
| double | m_bigM |
| Value of the big M constant. More... | |
| map< string, uint > | m_numPartitionsMap |
| string | m_folder |
| Name of the folder where to write the text file. More... | |
| uint | m_numBits |
| Number of bits used to approximate the real valued variables affecting the uncertainty set. More... | |
Additional Inherited Members | |
Protected Attributes inherited from DecisionRuleIF | |
| uint | m_memory |
| Memory of this approximator. More... | |
Piecewise constant and piecewise linear decision rule approximator.
| PiecewiseDecisionRule::PiecewiseDecisionRule | ( | const map< string, uint > & | numPartitionsMap = map<string, uint>(), |
| double | bigM = 100., |
||
| bool | useExplicitNACs = false, |
||
| string | folder = " " |
||
| ) |
Constructor of the PiecewiseDecisionRule class.
| numPartitionsMap | map from the name of the uncertain parameter to the number of subsets along that direction (number of breakpoints + 1) |
| bigM | Big-M value used for linearizing the bilinear terms |
| useExplicitNACs | If true, then two meansurement variables are equal, otherwise use the same measurement variables for the NACs |
| folder | Name of folders where to store the log file |
|
inline |
Constructor of the PiecewiseApproximator class Directly initialize with the predefined private members (for greater customization)
Destructor of the PiecewiseApproximator class
|
virtual |
Approximate the input model First construct the partition maps, then calculate and robustity the model on each subset, finally add non-anticipativity constraints.
Implements DecisionRuleIF.
|
private |
Calculate the probability of the given subset of the partition and the means of the uncertain parameters on it.
| void PiecewiseDecisionRule::calculateSolution | ( | ROCPPOptModelIF_Ptr | pIn, |
| const map< string, double > & | resultIn, | ||
| ROCPPUnc_Ptr | unc, | ||
| string | partition | ||
| ) |
Calculate the measurement variable value for the given uncertainty on the given subset of the partition.
| void PiecewiseDecisionRule::calculateSolution | ( | ROCPPOptModelIF_Ptr | pIn, |
| const map< string, double > & | resultIn, | ||
| ROCPPVarIF_Ptr | dv, | ||
| string | partition | ||
| ) |
Calculate solution for the given variable on the given subset of the partition.
|
private |
Create the map from partition to map from uncertain parameter in original problem to uncertainty on partition.
|
private |
Create the map from partition to map from variable in original problem to variable on partition.
| pair< bool, ROCPPVarIF_Ptr > PiecewiseDecisionRule::findOrigVariable | ( | ROCPPVarIF_Ptr | newdv | ) | const |
Find the variable that new decision variable originated from after LDR and CDR.
|
inlinevirtual |
Implements ReformulationStrategyIF.
| string PiecewiseDecisionRule::getSolutionApproachParameters | ( | string | delimiter | ) | const |
Return a new model after fixing the binary variables to the value provided in the input map.
|
private |
Calculate the value of the objective on the given subset of the partition.
| ROCPPVarIF_Ptr PiecewiseDecisionRule::getVarOnPartition | ( | string | partition, |
| string | origVarName | ||
| ) | const |
Get the decision variable on the the given subset of the partition for the given original variable.
| void PiecewiseDecisionRule::getWsSolutions | ( | ROCPPOptModelIF_Ptr | pIn, |
| const map< string, double > & | warmStartResults, | ||
| const map< string, 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 do not exist in the warm start problem to the solutions on the nearest partition.
| 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 |
|
private |
Initialize the class with the given parameters.
|
virtual |
Implements ReformulationStrategyIF.
| void PiecewiseDecisionRule::printOut | ( | const ROCPPOptModelIF_Ptr | pIn, |
| const map< string, double > & | resultIn, | ||
| ROCPPUnc_Ptr | unc | ||
| ) |
Print out whether we observe or not the given uncertainty on all subsets of the partition.
| void PiecewiseDecisionRule::printOut | ( | const ROCPPOptModelIF_Ptr | pIn, |
| const map< string, double > & | resultIn, | ||
| ROCPPUnc_Ptr | unc, | ||
| map< ROCPPUnc_Ptr, uint > | partitionIn | ||
| ) |
Print out whether observe or not the given uncertainty on the given subset of the partition.
| void PiecewiseDecisionRule::printOut | ( | const ROCPPOptModelIF_Ptr | pIn, |
| const map< string, double > & | resultIn, | ||
| ROCPPVarIF_Ptr | dv | ||
| ) |
Print out the solution for the given variable on all subsets of the the partition.
| void PiecewiseDecisionRule::printOut | ( | const ROCPPOptModelIF_Ptr | pIn, |
| const map< string, double > & | resultIn, | ||
| ROCPPVarIF_Ptr | dv, | ||
| map< ROCPPUnc_Ptr, uint > | partitionIn | ||
| ) |
Print out the solution for the given variable on the given subset of the partition.
| void PiecewiseDecisionRule::printParametersToScreen | ( | ) | const |
|
inlinevirtual |
Implements ReformulationStrategyIF.
|
private |
Value of the big M constant.
|
private |
Name of the folder where to write the text file.
|
private |
Number of bits used to approximate the real valued variables affecting the uncertainty set.
|
private |
|
private |
String encoding the number of subsets in the partition for every observable uncertainty in the problem, in alphabetical order.
|
private |
|
private |
Linear decision rule converter.
|
private |
Constant decision rule converter.
|
private |
|
private |
Partition constructor of this approximator.
|
private |
Partition converter of this approximator.
|
private |
Use constraints to describe the non anticipativity constraints.
|
private |
Map from subset of partition to map from variable in original problem to variable on subset of the partition.