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

K-adapatability partition encorder class. More...

#include <Kadaptability.hpp>

Public Types

typedef map< string, map< uint, uint > >::const_iterator Kmap_iterator
 Constant iterator for m_mapPartitionNme_to_mapTime_to_k. More...
 
typedef map< uint, map< string, map< uint, uint > > >::const_iterator Klargemap_iterator
 Constant iterator for m_mapt_mapPartitionNme_to_mapTime_to_k. More...
 
typedef map< uint, uint >::const_iterator numPartitionMap_iterator
 Constant iterator for m_numPartitionsMap. More...
 

Public Member Functions

 KadaptabilityPartitionEncoderMS (ROCPPOptModelIF_Ptr pIn, string numPartitionsStr)
 Construct encoder with different values of K_t in each time stage. More...
 
 KadaptabilityPartitionEncoderMS (const map< uint, uint > &numPartitionsMap)
 Construct encoder with different values of K_t in each time stage. More...
 
 KadaptabilityPartitionEncoderMS (uint T, uint K)
 Construct encoder with same K across all time stages. More...
 
 ~KadaptabilityPartitionEncoderMS ()
 Destructor of K-Adaptability partition encoder. More...
 
Kmap_iterator Kmap_iteratorBegin () const
 Return the constant iterator pointing to the beginning of the m_mapPartitionNme_to_mapTime_to_k. More...
 
Kmap_iterator Kmap_iteratorEnd () const
 Return the constant iterator pointing to the end of the m_mapPartitionNme_to_mapTime_to_k. More...
 
Klargemap_iterator Klargemap_iteratorBegin () const
 Return the constant iterator pointing to the beginning of m_mapt_mapPartitionNme_to_mapTime_to_k. More...
 
Klargemap_iterator Klargemap_iteratorEnd () const
 Return the constant iterator pointing to the end of m_mapt_mapPartitionNme_to_mapTime_to_k. More...
 
numPartitionMap_iterator numPartitionMap_iteratorBegin () const
 Return the constant iterator pointing to the beginning of the m_numPartitionsMap. More...
 
numPartitionMap_iterator numPartitionMap_iteratorEnd () const
 Return the constant iterator pointing to the end of the m_numPartitionsMap. More...
 
void getReady ()
 Construct the encoder, build the maps. More...
 
string convertPartitionToString (const vector< uint > &partition) const
 Convert the contingency plan in the input vector to a string. More...
 
string convertPartitionToString (const map< uint, uint > &partitionMap) const
 Convert the contingency plan in the input map to a string. More...
 
uint getKt (uint t) const
 Return the total number of contingency plans for the given time stage. More...
 
uint getkt (string partition, uint t) const
 Return the contingency plan for this time stage for the given contigency plan for the entire planning horizon. More...
 
uint getT () const
 Return the length of the planning horizon. More...
 
size_t getKmapSize () const
 Return the total number of contingency plans. More...
 
string getPartitionSubset (const map< uint, uint > &partitionMap, uint t) const
 Get the subset of the given partition map up to the given time stage. More...
 
string getBasicPartition () const
 Get the first subset in this encoder. More...
 
string getMaxPartitionString () const
 

Private Attributes

map< uint, uintm_numPartitionsMap
 Map from time period to value of K for that time-period. More...
 
map< string, map< uint, uint > > m_mapPartitionNme_to_mapTime_to_k
 Map from partition name to map from time period to value of k for that period. More...
 
map< uint, map< string, map< uint, uint > > > m_mapt_mapPartitionNme_to_mapTime_to_k
 Map from time t sub-partition name to map from time period to value of k for that period. More...
 

Detailed Description

K-adapatability partition encorder class.

Class for encoding the contingency plans in k-adaptability

Member Typedef Documentation

◆ Klargemap_iterator

typedef map< uint , map< string, map<uint, uint> > >::const_iterator KadaptabilityPartitionEncoderMS::Klargemap_iterator

Constant iterator for m_mapt_mapPartitionNme_to_mapTime_to_k.

◆ Kmap_iterator

typedef map<string, map<uint, uint> >::const_iterator KadaptabilityPartitionEncoderMS::Kmap_iterator

Constant iterator for m_mapPartitionNme_to_mapTime_to_k.

◆ numPartitionMap_iterator

Constant iterator for m_numPartitionsMap.

Constructor & Destructor Documentation

◆ KadaptabilityPartitionEncoderMS() [1/3]

KadaptabilityPartitionEncoderMS::KadaptabilityPartitionEncoderMS ( ROCPPOptModelIF_Ptr  pIn,
string  numPartitionsStr 
)

Construct encoder with different values of K_t in each time stage.

Parameters
numPartitionsStrString encoding the number of contingency plans for each time period from 1 to T

◆ KadaptabilityPartitionEncoderMS() [2/3]

KadaptabilityPartitionEncoderMS::KadaptabilityPartitionEncoderMS ( const map< uint, uint > &  numPartitionsMap)

Construct encoder with different values of K_t in each time stage.

Parameters
numPartitionsMapMap from each time period to a value of K for that period

◆ KadaptabilityPartitionEncoderMS() [3/3]

KadaptabilityPartitionEncoderMS::KadaptabilityPartitionEncoderMS ( uint  T,
uint  K 
)

Construct encoder with same K across all time stages.

Parameters
TTotal number of time stages
KValue of K

◆ ~KadaptabilityPartitionEncoderMS()

KadaptabilityPartitionEncoderMS::~KadaptabilityPartitionEncoderMS ( )
inline

Destructor of K-Adaptability partition encoder.

Member Function Documentation

◆ convertPartitionToString() [1/2]

string KadaptabilityPartitionEncoderMS::convertPartitionToString ( const map< uint, uint > &  partitionMap) const

Convert the contingency plan in the input map to a string.

Parameters
partitionMapMap of time stage to number of case on that partition

◆ convertPartitionToString() [2/2]

string KadaptabilityPartitionEncoderMS::convertPartitionToString ( const vector< uint > &  partition) const

Convert the contingency plan in the input vector to a string.

Parameters
partitionVector of number of case for each time stage

◆ getBasicPartition()

string KadaptabilityPartitionEncoderMS::getBasicPartition ( ) const
inline

Get the first subset in this encoder.

◆ getKmapSize()

size_t KadaptabilityPartitionEncoderMS::getKmapSize ( ) const
inline

Return the total number of contingency plans.

◆ getkt()

uint KadaptabilityPartitionEncoderMS::getkt ( string  partition,
uint  t 
) const

Return the contingency plan for this time stage for the given contigency plan for the entire planning horizon.

◆ getKt()

uint KadaptabilityPartitionEncoderMS::getKt ( uint  t) const

Return the total number of contingency plans for the given time stage.

◆ getMaxPartitionString()

string KadaptabilityPartitionEncoderMS::getMaxPartitionString ( ) const
inline

◆ getPartitionSubset()

string KadaptabilityPartitionEncoderMS::getPartitionSubset ( const map< uint, uint > &  partitionMap,
uint  t 
) const

Get the subset of the given partition map up to the given time stage.

◆ getReady()

void KadaptabilityPartitionEncoderMS::getReady ( )

Construct the encoder, build the maps.

◆ getT()

uint KadaptabilityPartitionEncoderMS::getT ( ) const
inline

Return the length of the planning horizon.

◆ Klargemap_iteratorBegin()

Klargemap_iterator KadaptabilityPartitionEncoderMS::Klargemap_iteratorBegin ( ) const
inline

Return the constant iterator pointing to the beginning of m_mapt_mapPartitionNme_to_mapTime_to_k.

◆ Klargemap_iteratorEnd()

Klargemap_iterator KadaptabilityPartitionEncoderMS::Klargemap_iteratorEnd ( ) const
inline

Return the constant iterator pointing to the end of m_mapt_mapPartitionNme_to_mapTime_to_k.

◆ Kmap_iteratorBegin()

Kmap_iterator KadaptabilityPartitionEncoderMS::Kmap_iteratorBegin ( ) const
inline

Return the constant iterator pointing to the beginning of the m_mapPartitionNme_to_mapTime_to_k.

◆ Kmap_iteratorEnd()

Kmap_iterator KadaptabilityPartitionEncoderMS::Kmap_iteratorEnd ( ) const
inline

Return the constant iterator pointing to the end of the m_mapPartitionNme_to_mapTime_to_k.

◆ numPartitionMap_iteratorBegin()

numPartitionMap_iterator KadaptabilityPartitionEncoderMS::numPartitionMap_iteratorBegin ( ) const
inline

Return the constant iterator pointing to the beginning of the m_numPartitionsMap.

◆ numPartitionMap_iteratorEnd()

numPartitionMap_iterator KadaptabilityPartitionEncoderMS::numPartitionMap_iteratorEnd ( ) const
inline

Return the constant iterator pointing to the end of the m_numPartitionsMap.

Member Data Documentation

◆ m_mapPartitionNme_to_mapTime_to_k

map<string, map<uint, uint> > KadaptabilityPartitionEncoderMS::m_mapPartitionNme_to_mapTime_to_k
private

Map from partition name to map from time period to value of k for that period.

◆ m_mapt_mapPartitionNme_to_mapTime_to_k

map< uint , map< string, map<uint, uint> > > KadaptabilityPartitionEncoderMS::m_mapt_mapPartitionNme_to_mapTime_to_k
private

Map from time t sub-partition name to map from time period to value of k for that period.

◆ m_numPartitionsMap

map<uint,uint> KadaptabilityPartitionEncoderMS::m_numPartitionsMap
private

Map from time period to value of K for that time-period.