Scippy

UG

Ubiquity Generator framework

BbParaNodePoolForCleanUp Class Reference

class BbParaNodePoolForCleanUp More...

#include <bbParaNodePool.h>

Inheritance diagram for BbParaNodePoolForCleanUp:
BbParaNodePool

Public Member Functions

 BbParaNodePoolForCleanUp (double inBgap)
 constructor More...
 
 ~BbParaNodePoolForCleanUp ()
 destructor More...
 
void insert (BbParaNodePtr paraNode)
 insert BbParaNode to this pool More...
 
bool isEmpty ()
 check if this pool is empty or not More...
 
BbParaNodePtr extractNode ()
 extract a BbParaNode object from this pool More...
 
BbParaNodePtr extractWorstNode ()
 extract a BbParaNode object with the lowest priority from this pool More...
 
BbParaNodePtr extractNodeRandomly ()
 extract a BbParaNode object randomly from this pool More...
 
void updateDualBoundsForSavingNodes ()
 update dual bound values for saving BbParaNodes to checkpoint file More...
 
int writeBbParaNodesToCheckpointFile (gzstream::ogzstream &out)
 write BbParaNodes to checkpoint file More...
 
double getBestDualBoundValue ()
 get best dual bound value of BbParaNode object in this pool More...
 
unsigned int getNumOfGoodNodes (double globalBestBound)
 get number of good (heavy) BbParaNodes in this pool More...
 
size_t getNumOfNodes ()
 get number of BbParaNodes in this pool More...
 
int removeBoundedNodes (double incumbentValue)
 remove bounded BbParaNodes by given incumbnet value More...
 
int removeMergedNodes (BbParaMergedNodeListElement *head)
 remove merged BbParaNodes from this pool More...
 
const std::string toString ()
 stringfy this object More...
 
- Public Member Functions inherited from BbParaNodePool
 BbParaNodePool (double inBgap)
 constructor More...
 
virtual ~BbParaNodePool ()
 destructor More...
 
virtual void insert (BbParaNodePtr node)=0
 insert BbParaNode to this pool More...
 
virtual bool isEmpty ()=0
 check if this pool is empty or not More...
 
virtual BbParaNodePtr extractNode ()=0
 extract a BbParaNode object from this pool More...
 
virtual BbParaNodePtr extractWorstNode ()=0
 extract a BbParaNode object with the lowest priority from this pool More...
 
virtual BbParaNodePtr extractNodeRandomly ()=0
 extract a BbParaNode object randomly from this pool More...
 
virtual double getBestDualBoundValue ()=0
 get best dual bound value of BbParaNode object in this pool More...
 
virtual unsigned int getNumOfGoodNodes (double globalBestBound)=0
 get number of good (heavy) BbParaNodes in this pool More...
 
virtual size_t getNumOfNodes ()=0
 get number of BbParaNodes in this pool More...
 
virtual int removeBoundedNodes (double incumbentValue)=0
 remove bounded BbParaNodes by given incumbnet value More...
 
virtual void updateDualBoundsForSavingNodes ()=0
 update dual bound values for saving BbParaNodes to checkpoint file More...
 
virtual int writeBbParaNodesToCheckpointFile (gzstream::ogzstream &out)=0
 write BbParaNodes to checkpoint file More...
 
virtual int removeMergedNodes (BbParaMergedNodeListElement *head)=0
 remove merged BbParaNodes from this pool More...
 
virtual const std::string toString ()=0
 stringfy this object More...
 
size_t getMaxUsageOfPool ()
 get maximum usage of this pool More...
 

Private Attributes

std::multimap< BbParaNodePtr, BbParaNodePtr, BbParaNodeSortCriterionForCleanUpdescendingPool
 

Additional Inherited Members

- Protected Attributes inherited from BbParaNodePool
double bgap
 gap which can be considered as good More...
 
size_t maxUsageOfPool
 maximum usage of this pool More...
 

Detailed Description

class BbParaNodePoolForCleanUp

Definition at line 754 of file bbParaNodePool.h.

Constructor & Destructor Documentation

◆ BbParaNodePoolForCleanUp()

BbParaNodePoolForCleanUp ( double  inBgap)

constructor

Parameters
inBgapgap which can be considered as good

Definition at line 763 of file bbParaNodePool.h.

◆ ~BbParaNodePoolForCleanUp()

destructor

Definition at line 773 of file bbParaNodePool.h.

References BbParaNodePoolForCleanUp::descendingPool.

Member Function Documentation

◆ extractNode()

BbParaNodePtr extractNode ( )
virtual

extract a BbParaNode object from this pool

Returns
pointer to BbParaNode object extracted

Implements BbParaNodePool.

Definition at line 815 of file bbParaNodePool.h.

References BbParaNodePoolForCleanUp::descendingPool, and THROW_LOGICAL_ERROR1.

◆ extractNodeRandomly()

BbParaNodePtr extractNodeRandomly ( )
virtual

extract a BbParaNode object randomly from this pool

Returns
pointer to BbParaNode object extracted

Implements BbParaNodePool.

Definition at line 850 of file bbParaNodePool.h.

References BbParaNodePoolForCleanUp::descendingPool, and THROW_LOGICAL_ERROR1.

◆ extractWorstNode()

BbParaNodePtr extractWorstNode ( )
virtual

extract a BbParaNode object with the lowest priority from this pool

Returns
pointer to BbParaNode object extracted

Implements BbParaNodePool.

Definition at line 839 of file bbParaNodePool.h.

◆ getBestDualBoundValue()

double getBestDualBoundValue ( )
virtual

get best dual bound value of BbParaNode object in this pool

Returns
best dual bound value

Implements BbParaNodePool.

Definition at line 915 of file bbParaNodePool.h.

References BbParaNodePoolForCleanUp::descendingPool.

◆ getNumOfGoodNodes()

unsigned int getNumOfGoodNodes ( double  globalBestBound)
virtual

get number of good (heavy) BbParaNodes in this pool

Returns
the number of good BbParaNodes

The following code is not a good idea, because only a node is received from a solver, LC can switch out if( globalBestBound > getBestDualBoundValue() ) globalBestBound = getBestDualBoundValue();

Parameters
globalBestBoundglobal best bound value to evaluate goodness

Implements BbParaNodePool.

Definition at line 934 of file bbParaNodePool.h.

References BbParaNodePool::bgap, and BbParaNodePoolForCleanUp::descendingPool.

◆ getNumOfNodes()

size_t getNumOfNodes ( )
virtual

get number of BbParaNodes in this pool

Returns
number of BbParaNodes

Implements BbParaNodePool.

Definition at line 959 of file bbParaNodePool.h.

References BbParaNodePoolForCleanUp::descendingPool.

◆ insert()

void insert ( BbParaNodePtr  paraNode)
virtual

insert BbParaNode to this pool

Parameters
paraNodepointer to BbParaNode object

Implements BbParaNodePool.

Definition at line 790 of file bbParaNodePool.h.

References BbParaNodePoolForCleanUp::descendingPool, and BbParaNodePool::maxUsageOfPool.

◆ isEmpty()

bool isEmpty ( )
virtual

check if this pool is empty or not

Returns
true if this pool is empty

Implements BbParaNodePool.

Definition at line 805 of file bbParaNodePool.h.

References BbParaNodePoolForCleanUp::descendingPool.

◆ removeBoundedNodes()

int removeBoundedNodes ( double  incumbentValue)
virtual

remove bounded BbParaNodes by given incumbnet value

Returns
the number of bounded BbParaNodes
Parameters
incumbentValueincumbent value

Implements BbParaNodePool.

Definition at line 969 of file bbParaNodePool.h.

References BbParaNodePoolForCleanUp::descendingPool, and THROW_LOGICAL_ERROR1.

◆ removeMergedNodes()

int removeMergedNodes ( BbParaMergedNodeListElement head)
virtual

remove merged BbParaNodes from this pool

Returns
the number of BbParaNodes removed
Parameters
headhead of Merged BbParaNodes list

Implements BbParaNodePool.

Definition at line 1006 of file bbParaNodePool.h.

References THROW_LOGICAL_ERROR1.

◆ toString()

const std::string toString ( )
virtual

stringfy this object

Returns
string which shows inside of this object as string

Implements BbParaNodePool.

Definition at line 1017 of file bbParaNodePool.h.

References BbParaNodePoolForCleanUp::descendingPool.

◆ updateDualBoundsForSavingNodes()

void updateDualBoundsForSavingNodes ( )
virtual

update dual bound values for saving BbParaNodes to checkpoint file

Implements BbParaNodePool.

Definition at line 873 of file bbParaNodePool.h.

References BbParaNodePoolForCleanUp::descendingPool.

◆ writeBbParaNodesToCheckpointFile()

int writeBbParaNodesToCheckpointFile ( gzstream::ogzstream &  out)
virtual

write BbParaNodes to checkpoint file

Returns
number of BbParaNodes written
Parameters
outgzstram for output

Implements BbParaNodePool.

Definition at line 892 of file bbParaNodePool.h.

References BbParaNodePoolForCleanUp::descendingPool.

Member Data Documentation

◆ descendingPool