ROC++  v1.2
Automatic Robust Optimization in C++
PartitionConstructorIF Class Referenceabstract

Partition constructor interface. More...

#include <PWDecisionRule.hpp>

Inheritance diagram for PartitionConstructorIF:

Public Types

typedef map< string, map< string, uint > >::const_iterator const_iterator
 Constant iterator of the partition map. More...
 
typedef vector< ROCPPConstraintIF_Ptr >::const_iterator usconstraints_iterator
 Constant iterator of the vector of uncertainty set constraints. More...
 
typedef vector< ROCPPConstraintIF_Ptr >::const_iterator addconstraints_iterator
 Constant iterator of the vector of additional constraints. More...
 

Public Member Functions

 PartitionConstructorIF (const map< string, uint > &numPartitionsMap)
 
 ~PartitionConstructorIF ()
 
const_iterator begin () const
 Return a constant iterator pointing to the beginning of m_partitionsMap. More...
 
const_iterator end () const
 Return a constant iterator pointing to the end of m_partitionsMap. More...
 
usconstraints_iterator USCbegin (string partition) const
 Return a constant iterator pointing to the beginning of constraints defining the uncertainty set on the given partition. More...
 
usconstraints_iterator USCend (string partition) const
 Return a constant iterator pointing to the end of constraints defining the uncertainty set on the given partition. More...
 
ROCPPUnc_Ptr getUncOnPartition (string partition, string origUncName) const
 Get the uncertain parameter on the the given subset of the partition for the given original uncertain parameter. More...
 
addconstraints_iterator ACbegin () const
 Return a constant iterator pointing to the beginning of m_additionalConstraints. More...
 
addconstraints_iterator ACend () const
 Return a constant iterator pointing to the end of m_additionalConstraints. More...
 
void getReady (ROCPPOptModelIF_Ptr pIn, ROCPPParConverter_Ptr pPartConverter, ROCPPMItoMB_Ptr pMIMBConverter, map< string, pair< double, double > > &margSupp, const map< string, pair< double, double > > &OAmargSupp, string solver="gurobi")
 Calculate the upper and lower bounds for each uncertainty. More...
 
void Reset ()
 Reset all maps in this container. More...
 
virtual void constructUncToBreakpointMap (const map< string, pair< double, double > > &margSupp)=0
 Decide on the breakpoint of each uncertainty and store the information in the maps. More...
 
ROCPPconstdvContainer_Ptr getBPDVContainer () const
 
size_t getNumSubsets () const
 Get the total number of subsets. More...
 
uint getNumSubsets (string uncNme) const
 Get the number of subsets for the given uncertainty. More...
 
uint getPos (string partition, string uncNme) const
 
bool hasPartition (string uncNme) const
 
ROCPPExpr_Ptr getBp (pair< string, uint > uncOnPartition) const
 
map< string, uintgetNumPartitionsMap () const
 

Protected Member Functions

void constructPartitionsMap (ROCPPOptModelIF_Ptr pIn, ROCPPParConverter_Ptr pPartConverter)
 

Protected Attributes

map< string, uintm_numPartitionsMap
 Map from uncertainty to number of breakpoints in this direction. More...
 
map< string, map< string, uint > > m_partitionsMap
 Map from partition_name to map from unc name to element of parition associated with this uncertainty. More...
 
map< string, vector< ROCPPConstraintIF_Ptr > > m_partitionUSconstraints
 Map from partition name to the vector of constraints specific to this partition. More...
 
map< pair< string, uint >, ROCPPExpr_Ptrm_uncToBreakpointMap
 Map from pair<unc name,breakpoint number> to dv modeling the breakpoint. More...
 
vector< ROCPPConstraintIF_Ptrm_additionalConstraints
 Vector of additional constraints. More...
 
ROCPPdvContainer_Ptr m_bpdvs
 Container of breakpoint variables. More...
 

Detailed Description

Partition constructor interface.

Class for constructing partitions of uncertainty set

Member Typedef Documentation

◆ addconstraints_iterator

Constant iterator of the vector of additional constraints.

◆ const_iterator

typedef map<string, map<string,uint> >::const_iterator PartitionConstructorIF::const_iterator

Constant iterator of the partition map.

◆ usconstraints_iterator

Constant iterator of the vector of uncertainty set constraints.

Constructor & Destructor Documentation

◆ PartitionConstructorIF()

PartitionConstructorIF::PartitionConstructorIF ( const map< string, uint > &  numPartitionsMap)
Parameters
numPartitionsMapMap from uncertainty name to number of break points in this direction

◆ ~PartitionConstructorIF()

PartitionConstructorIF::~PartitionConstructorIF ( )
inline

Member Function Documentation

◆ ACbegin()

addconstraints_iterator PartitionConstructorIF::ACbegin ( ) const
inline

Return a constant iterator pointing to the beginning of m_additionalConstraints.

◆ ACend()

addconstraints_iterator PartitionConstructorIF::ACend ( ) const
inline

Return a constant iterator pointing to the end of m_additionalConstraints.

◆ begin()

const_iterator PartitionConstructorIF::begin ( ) const
inline

Return a constant iterator pointing to the beginning of m_partitionsMap.

◆ constructPartitionsMap()

void PartitionConstructorIF::constructPartitionsMap ( ROCPPOptModelIF_Ptr  pIn,
ROCPPParConverter_Ptr  pPartConverter 
)
protected

◆ constructUncToBreakpointMap()

virtual void PartitionConstructorIF::constructUncToBreakpointMap ( const map< string, pair< double, double > > &  margSupp)
pure virtual

Decide on the breakpoint of each uncertainty and store the information in the maps.

Implemented in AdaptivePartitionConstructor, and StaticPartitionConstructor.

◆ end()

const_iterator PartitionConstructorIF::end ( ) const
inline

Return a constant iterator pointing to the end of m_partitionsMap.

◆ getBp()

ROCPPExpr_Ptr PartitionConstructorIF::getBp ( pair< string, uint uncOnPartition) const

◆ getBPDVContainer()

ROCPPconstdvContainer_Ptr PartitionConstructorIF::getBPDVContainer ( ) const
inline

◆ getNumPartitionsMap()

map<string,uint> PartitionConstructorIF::getNumPartitionsMap ( ) const
inline

◆ getNumSubsets() [1/2]

size_t PartitionConstructorIF::getNumSubsets ( ) const
inline

Get the total number of subsets.

◆ getNumSubsets() [2/2]

uint PartitionConstructorIF::getNumSubsets ( string  uncNme) const

Get the number of subsets for the given uncertainty.

◆ getPos()

uint PartitionConstructorIF::getPos ( string  partition,
string  uncNme 
) const

◆ getReady()

void PartitionConstructorIF::getReady ( ROCPPOptModelIF_Ptr  pIn,
ROCPPParConverter_Ptr  pPartConverter,
ROCPPMItoMB_Ptr  pMIMBConverter,
map< string, pair< double, double > > &  margSupp,
const map< string, pair< double, double > > &  OAmargSupp,
string  solver = "gurobi" 
)

Calculate the upper and lower bounds for each uncertainty.

◆ getUncOnPartition()

ROCPPUnc_Ptr PartitionConstructorIF::getUncOnPartition ( string  partition,
string  origUncName 
) const

Get the uncertain parameter on the the given subset of the partition for the given original uncertain parameter.

◆ hasPartition()

bool PartitionConstructorIF::hasPartition ( string  uncNme) const

◆ Reset()

void PartitionConstructorIF::Reset ( )
inline

Reset all maps in this container.

◆ USCbegin()

PartitionConstructorIF::usconstraints_iterator PartitionConstructorIF::USCbegin ( string  partition) const

Return a constant iterator pointing to the beginning of constraints defining the uncertainty set on the given partition.

◆ USCend()

PartitionConstructorIF::usconstraints_iterator PartitionConstructorIF::USCend ( string  partition) const

Return a constant iterator pointing to the end of constraints defining the uncertainty set on the given partition.

Member Data Documentation

◆ m_additionalConstraints

vector<ROCPPConstraintIF_Ptr> PartitionConstructorIF::m_additionalConstraints
protected

Vector of additional constraints.

◆ m_bpdvs

ROCPPdvContainer_Ptr PartitionConstructorIF::m_bpdvs
protected

Container of breakpoint variables.

◆ m_numPartitionsMap

map<string,uint> PartitionConstructorIF::m_numPartitionsMap
protected

Map from uncertainty to number of breakpoints in this direction.

◆ m_partitionsMap

map<string, map<string,uint> > PartitionConstructorIF::m_partitionsMap
protected

Map from partition_name to map from unc name to element of parition associated with this uncertainty.

◆ m_partitionUSconstraints

map< string, vector< ROCPPConstraintIF_Ptr> > PartitionConstructorIF::m_partitionUSconstraints
protected

Map from partition name to the vector of constraints specific to this partition.

◆ m_uncToBreakpointMap

map< pair<string,uint>, ROCPPExpr_Ptr> PartitionConstructorIF::m_uncToBreakpointMap
protected

Map from pair<unc name,breakpoint number> to dv modeling the breakpoint.