Scippy

UG

Ubiquity Generator framework

BbParaSolverPoolElement Class Reference

class BbParaSolverPoolElement (This class includes information about a Solver status) More...

#include <bbParaSolverPool.h>

Public Member Functions

 BbParaSolverPoolElement (int inRank)
 constructor More...
 
 ~BbParaSolverPoolElement ()
 destractor More...
 
int getRank ()
 get rank of the Solver More...
 
ParaTaskgetCurrentNode ()
 get current solving BbParaNode More...
 
BbParaNodegetSelfSplitNodes ()
 get a list of nodes which are generated by self-split ramp-up More...
 
BbParaNodeextractSelfSplitNodes ()
 extract a list of nodes which are generated by self-split ramp-up More...
 
void addSubtreeRoot (BbParaNode *inNode)
 add subtree root node More...
 
void makeSubtreeRootCurrent (BbParaNode *inNode)
 make subtree root node current More...
 
void removeSubtreeRoot (BbParaNode *inNode)
 remove subtree root node in self-split nodes list More...
 
BbParaNodeextractSubtreeRoot (BbParaNode *inNode)
 extract subtree root node More...
 
BbParaNodeextractCurrentNode ()
 extract current solving BbParaNode More...
 
void deleteCurrentNode ()
 delete current solving BbParaNode More...
 
BbParaSolverPoolElementPtrgetSelectionHeapElement ()
 extract current solving BbParaNode More...
 
void setSelectionHeapElement (BbParaSolverPoolElementPtr *inSelectionHeapElement)
 set selection heap element More...
 
BbParaSolverPoolElementPtrgetCollectingModeSolverHeapElement ()
 get collecting mode Solver heap element More...
 
void setCollectingModeSolverHeapElement (BbParaSolverPoolElementPtr *inCollectingModeSolverHeapElement)
 set collecting mode Solver heap element More...
 
long long getNumOfNodesSolved ()
 get number of nodes solved More...
 
int getNumOfNodesLeft ()
 get number of nodes left More...
 
void setNumOfNodesSolved (long long inNumOfNodesSolved)
 set number of nodes solved More...
 
int getNumOfDiffNodesSolved ()
 get number of nodes left difference between current number and that in the previous notification time More...
 
void setNumOfDiffNodesSolved (int inNumOfDiff)
 set number of nodes left difference between current number and that in the previous notification time More...
 
void setNumOfNodesLeft (int inNumOfNodesLeft)
 set number of nodes left More...
 
void setDualBoundValue (double dualBoundValue)
 set dual bound value on paraNode More...
 
int getNumOfDiffNodesLeft ()
 get number of nodes left difference between current number and that in the previous notification time More...
 
void setNumOfDiffNodesLeft (int inNumOfDiff)
 set number of nodes left difference between current number and that in the previous notification time More...
 
double getBestDualBoundValue ()
 get best dual bound value More...
 
void setBestDualBoundValue (double inBestDualBoundValue)
 set best dual bound value More...
 
void activate (BbParaNode *inNode)
 activate this Solver More...
 
void racingActivate ()
 activate this Solver as a racing Solver More...
 
void inactivate ()
 inactivate this Solver More...
 
BbParaNodedied ()
 kill this Solver More...
 
SolverStatus getStatus ()
 get Solver status More...
 
void interruptRequested ()
 set TerminateRequseted on Solver status More...
 
void terminateRequested ()
 set TerminateRequseted on Solver status More...
 
void terminated ()
 set Terminated on Solver status More...
 
bool isActive ()
 check if this Solver is active or not More...
 
bool isOutCollectingMode ()
 check if this Solver is out of collecting mode or not More...
 
bool isInCollectingMode ()
 check if this Solver is in collecting mode or not More...
 
void setCollectingMode (bool b)
 set collecting mode More...
 
bool isCandidateOfCollecting ()
 check if this Solver is candidate of collecting mode Solver More...
 
void setCandidateOfCollecting (bool b)
 set candidate of collecting mode Solver More...
 
void setTermState (ParaSolverTerminationState *inTermState)
 set termination state More...
 
ParaSolverTerminationStategetTermState ()
 get termination state More...
 
void switchIntoEvaluation ()
 switch into evaluation stage More...
 
void switchOutEvaluation ()
 switch out of evaluation stage More...
 
bool isRacingStage ()
 check if this Solver is in racing stage More...
 
bool isEvaluationStage ()
 check if this Solver is in evaluation stage More...
 
void setNoGenerator ()
 make this Solver No generator More...
 
bool isGenerator ()
 check if this Solver is generator or not *‍/ More...
 
void prohibitCollectingMode ()
 prohibits to be in collecting mode More...
 
void setCollectingIsAllowed ()
 allows to be in collecting mode More...
 
bool isCollectingProhibited ()
 check if this Solver cannot be allowed in collecting mode More...
 
bool isDualBoundGainTesting ()
 check if dual bound gain is testing in this Solver or not More...
 
void setDualBoundGainTesting (bool value)
 set dual bound gain is testing value More...
 

Private Attributes

int rank
 rank of the Solver More...
 
SolverStatus status
 status of the Solver More...
 
bool collectingMode
 indicate if current Solver is in collecting mode or not More...
 
bool candidateOfCollecting
 indicate that this Solver is a candidate of collecting mode Solver More...
 
bool generator
 this Solver can generate subproblems More...
 
bool collectingIsProhibited
 collecting is temporary prohibited More...
 
bool dualBoundGainTesting
 indicate that dual bound gain is testing or not More...
 
BbParaNodecurrentNode
 solving node More...
 
BbParaNodeselfSplitNodes
 list of nodes generated by self-split ramp-up More...
 
BbParaSolverPoolElementPtrselectionHeapElement
 pointer to selection heap element More...
 
BbParaSolverPoolElementPtrcollectingModeSolverHeapElement
 
long long numOfNodesSolved
 number of nodes solved. -1 is the special value which means never updated in racing More...
 
int numOfDiffNodesSolved
 number of nodes solved difference between current number and that in the previous notification time More...
 
int numOfNodesLeft
 number of nodes left More...
 
int numOfDiffNodesLeft
 number of nodes left difference between current number and that in the previous notification time More...
 
double bestDualBoundValue
 best dual bound value of the Solver More...
 
ParaSolverTerminationStatetermState
 Solver termination statistics: for checkpoint. More...
 

Detailed Description

class BbParaSolverPoolElement (This class includes information about a Solver status)

Definition at line 63 of file bbParaSolverPool.h.

Constructor & Destructor Documentation

◆ BbParaSolverPoolElement()

BbParaSolverPoolElement ( int  inRank)

constructor

Definition at line 95 of file bbParaSolverPool.h.

◆ ~BbParaSolverPoolElement()

Member Function Documentation

◆ activate()

◆ addSubtreeRoot()

void addSubtreeRoot ( BbParaNode inNode)

add subtree root node

add the end, since it would be most like to be solved in this order

Parameters
inNodeBbParaNode to be added

Definition at line 219 of file bbParaSolverPool.h.

References ParaTask::isRootTask(), BbParaNode::next, and BbParaSolverPoolElement::selfSplitNodes.

◆ deleteCurrentNode()

void deleteCurrentNode ( )

delete current solving BbParaNode

Definition at line 384 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::currentNode, and BbParaNode::next.

◆ died()

◆ extractCurrentNode()

BbParaNode * extractCurrentNode ( )

◆ extractSelfSplitNodes()

BbParaNode * extractSelfSplitNodes ( )

extract a list of nodes which are generated by self-split ramp-up

Returns
pointer to BbParaNode object

Definition at line 172 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::selfSplitNodes.

Referenced by BbParaSolverPool::extractSelfSplitSubtreeRootNodes().

◆ extractSubtreeRoot()

BbParaNode * extractSubtreeRoot ( BbParaNode inNode)

extract subtree root node

Parameters
inNodeBbParaNode to be removed

Definition at line 326 of file bbParaSolverPool.h.

References BbParaNode::isSameNodeIdAs(), BbParaNode::next, BbParaSolverPoolElement::selfSplitNodes, and THROW_LOGICAL_ERROR1.

◆ getBestDualBoundValue()

◆ getCollectingModeSolverHeapElement()

◆ getCurrentNode()

ParaTask * getCurrentNode ( )

get current solving BbParaNode

Returns
pointer to BbParaNode object

Definition at line 152 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::currentNode.

Referenced by BbParaSolverPool::currentSolvingNodehaeDescendant(), and BbParaSolverPool::getCurrentTask().

◆ getNumOfDiffNodesLeft()

int getNumOfDiffNodesLeft ( )

get number of nodes left difference between current number and that in the previous notification time

Returns
number of nodes left difference between current number and that in the previous notification time

Definition at line 521 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::numOfDiffNodesLeft.

Referenced by SelectionHeap::toString(), and CollectingModeSolverHeap::toString().

◆ getNumOfDiffNodesSolved()

int getNumOfDiffNodesSolved ( )

get number of nodes left difference between current number and that in the previous notification time

Returns
number of nodes left difference between current number and that in the previous notification time

Definition at line 480 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::numOfDiffNodesSolved.

◆ getNumOfNodesLeft()

◆ getNumOfNodesSolved()

long long getNumOfNodesSolved ( )

◆ getRank()

◆ getSelectionHeapElement()

BbParaSolverPoolElementPtr * getSelectionHeapElement ( )

extract current solving BbParaNode

Returns
pointer to BbParaNode object get selection heap element
pointer to BbParaSolverPoolElementPtr

Definition at line 410 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::selectionHeapElement.

Referenced by DescendingSelectionHeap::deleteElement(), AscendingSelectionHeap::deleteElement(), DescendingSelectionHeap::updateDualBoundValue(), and AscendingSelectionHeap::updateDualBoundValue().

◆ getSelfSplitNodes()

BbParaNode * getSelfSplitNodes ( )

get a list of nodes which are generated by self-split ramp-up

Returns
pointer to BbParaNode object

Definition at line 162 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::selfSplitNodes.

◆ getStatus()

◆ getTermState()

ParaSolverTerminationState * getTermState ( )

get termination state

Returns
pointer to ParaSolverTerminationState object

Definition at line 747 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::termState.

Referenced by BbParaSolverPool::getTermState(), and BbParaSolverPool::writeSolverStatisticsToCheckpointFile().

◆ inactivate()

◆ interruptRequested()

void interruptRequested ( )

set TerminateRequseted on Solver status

Definition at line 645 of file bbParaSolverPool.h.

References UG::InterruptRequested, and BbParaSolverPoolElement::status.

Referenced by BbParaSolverPool::interruptRequested(), and BbParaRacingSolverPool::interruptRequested().

◆ isActive()

bool isActive ( )

check if this Solver is active or not

Returns
true if this Solver is active, false otherwise

Definition at line 676 of file bbParaSolverPool.h.

References UG::Active, and BbParaSolverPoolElement::status.

Referenced by BbParaSolverPool::isSolverActive().

◆ isCandidateOfCollecting()

bool isCandidateOfCollecting ( )

check if this Solver is candidate of collecting mode Solver

Returns
true if this Solver is candidate, false otherwise

Definition at line 716 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::candidateOfCollecting.

◆ isCollectingProhibited()

bool isCollectingProhibited ( )

check if this Solver cannot be allowed in collecting mode

Returns
true if this Solver cannot be allowed in collecting mode, false otherwise

Definition at line 834 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::collectingIsProhibited.

Referenced by BbParaSolverPool::inactivateSolver(), BbParaSolverPool::resetCountersInSolver(), and BbParaSolverPoolForMinimization::updateSolverStatus().

◆ isDualBoundGainTesting()

bool isDualBoundGainTesting ( )

check if dual bound gain is testing in this Solver or not

Returns
true if dual bound gain is testing, false otherwise

Definition at line 844 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::dualBoundGainTesting.

Referenced by BbParaSolverPool::isDualBounGainTesting().

◆ isEvaluationStage()

bool isEvaluationStage ( )

check if this Solver is in evaluation stage

Returns
true if this Solver is in evaluation stage, false otherwise

Definition at line 787 of file bbParaSolverPool.h.

References UG::RacingEvaluation, and BbParaSolverPoolElement::status.

◆ isGenerator()

bool isGenerator ( )

check if this Solver is generator or not *‍/

Returns
true if this Solver is generator, false otherwise

Definition at line 806 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::generator.

Referenced by BbParaSolverPool::inactivateSolver(), BbParaSolverPool::resetCountersInSolver(), and BbParaSolverPoolForMinimization::updateSolverStatus().

◆ isInCollectingMode()

bool isInCollectingMode ( )

check if this Solver is in collecting mode or not

Returns
true if this Solver is in collecting mode, false otherwise

Definition at line 696 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::collectingMode.

Referenced by BbParaSolverPool::isSolverInCollectingMode(), SelectionHeap::toString(), CollectingModeSolverHeap::toString(), and BbParaSolverPoolForMinimization::updateSolverStatus().

◆ isOutCollectingMode()

bool isOutCollectingMode ( )

check if this Solver is out of collecting mode or not

Returns
true if this Solver is out of collecting mode, false otherwise

Definition at line 686 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::collectingMode.

Referenced by BbParaSolverPool::inactivateSolver(), BbParaSolverPool::resetCountersInSolver(), and BbParaSolverPoolForMinimization::updateSolverStatus().

◆ isRacingStage()

bool isRacingStage ( )

check if this Solver is in racing stage

Returns
true if this Solver is in racing stage, false otherwise

Definition at line 777 of file bbParaSolverPool.h.

References UG::Racing, and BbParaSolverPoolElement::status.

Referenced by BbParaRacingSolverPool::getStrActiveSolerNumbers().

◆ makeSubtreeRootCurrent()

void makeSubtreeRootCurrent ( BbParaNode inNode)

make subtree root node current

Parameters
inNodeBbParaNode to become current

Definition at line 243 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::currentNode, BbParaNode::isSameNodeIdAs(), BbParaNode::next, BbParaSolverPoolElement::selfSplitNodes, and THROW_LOGICAL_ERROR1.

◆ prohibitCollectingMode()

void prohibitCollectingMode ( )

prohibits to be in collecting mode

Definition at line 815 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::collectingIsProhibited.

Referenced by BbParaSolverPool::activateSolver().

◆ racingActivate()

◆ removeSubtreeRoot()

void removeSubtreeRoot ( BbParaNode inNode)

remove subtree root node in self-split nodes list

Parameters
inNodeBbParaNode to be removed

Definition at line 287 of file bbParaSolverPool.h.

References BbParaNode::isSameNodeIdAs(), BbParaNode::next, BbParaSolverPoolElement::selfSplitNodes, and THROW_LOGICAL_ERROR1.

◆ setBestDualBoundValue()

void setBestDualBoundValue ( double  inBestDualBoundValue)

◆ setCandidateOfCollecting()

void setCandidateOfCollecting ( bool  b)

set candidate of collecting mode Solver

Parameters
btrue or false to be set on candidate flag

Definition at line 725 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::candidateOfCollecting.

Referenced by BbParaSolverPoolForMinimization::switchInCollectingMode(), and BbParaSolverPool::switchOutCollectingMode().

◆ setCollectingIsAllowed()

void setCollectingIsAllowed ( )

◆ setCollectingMode()

◆ setCollectingModeSolverHeapElement()

void setCollectingModeSolverHeapElement ( BbParaSolverPoolElementPtr inCollectingModeSolverHeapElement)

◆ setDualBoundGainTesting()

void setDualBoundGainTesting ( bool  value)

set dual bound gain is testing value

Parameters
valuedual bound gain

Definition at line 853 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::dualBoundGainTesting.

Referenced by BbParaSolverPool::activateSolver(), BbParaSolverPool::switchOutCollectingMode(), and BbParaSolverPoolForMinimization::updateSolverStatus().

◆ setDualBoundValue()

void setDualBoundValue ( double  dualBoundValue)

set dual bound value on paraNode

Parameters
dualBoundValuedual bound value

Definition at line 510 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::currentNode, and BbParaSolverPoolElement::setDualBoundValue().

Referenced by BbParaSolverPoolElement::setDualBoundValue().

◆ setNoGenerator()

void setNoGenerator ( )

make this Solver No generator

Definition at line 796 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::generator.

Referenced by BbParaSolverPool::BbParaSolverPool().

◆ setNumOfDiffNodesLeft()

void setNumOfDiffNodesLeft ( int  inNumOfDiff)

set number of nodes left difference between current number and that in the previous notification time

Parameters
inNumOfDiffset number of nodes left difference between current number and that in the previous notification time

Definition at line 530 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::numOfDiffNodesLeft.

Referenced by BbParaRacingSolverPool::updateSolverStatus().

◆ setNumOfDiffNodesSolved()

void setNumOfDiffNodesSolved ( int  inNumOfDiff)

set number of nodes left difference between current number and that in the previous notification time

Parameters
inNumOfDiffnumber of nodes left difference between current number and that in the previous notification time

Definition at line 489 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::numOfDiffNodesSolved.

Referenced by BbParaRacingSolverPool::updateSolverStatus().

◆ setNumOfNodesLeft()

void setNumOfNodesLeft ( int  inNumOfNodesLeft)

set number of nodes left

Parameters
inNumOfNodesLeftnumber of nodes left

Definition at line 500 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::numOfNodesLeft.

Referenced by BbParaSolverPool::activateSolver(), and BbParaRacingSolverPool::updateSolverStatus().

◆ setNumOfNodesSolved()

void setNumOfNodesSolved ( long long  inNumOfNodesSolved)

set number of nodes solved

Parameters
inNumOfNodesSolvednumber of nodes solved

Definition at line 469 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::numOfNodesSolved.

Referenced by BbParaRacingSolverPool::updateSolverStatus().

◆ setSelectionHeapElement()

void setSelectionHeapElement ( BbParaSolverPoolElementPtr inSelectionHeapElement)

◆ setTermState()

void setTermState ( ParaSolverTerminationState inTermState)

set termination state

Parameters
inTermStatetermination state to be set

Definition at line 735 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::termState.

Referenced by BbParaSolverPool::setTermState().

◆ switchIntoEvaluation()

void switchIntoEvaluation ( )

switch into evaluation stage

Definition at line 756 of file bbParaSolverPool.h.

References UG::Racing, UG::RacingEvaluation, and BbParaSolverPoolElement::status.

Referenced by BbParaRacingSolverPool::updateSolverStatus().

◆ switchOutEvaluation()

void switchOutEvaluation ( )

switch out of evaluation stage

Definition at line 766 of file bbParaSolverPool.h.

References UG::Racing, UG::RacingEvaluation, and BbParaSolverPoolElement::status.

Referenced by BbParaRacingSolverPool::updateSolverStatus().

◆ terminated()

void terminated ( )

◆ terminateRequested()

void terminateRequested ( )

set TerminateRequseted on Solver status

Definition at line 655 of file bbParaSolverPool.h.

References BbParaSolverPoolElement::status, and UG::TerminateRequested.

Referenced by BbParaSolverPool::terminateRequested(), and BbParaRacingSolverPool::terminateRequested().

Member Data Documentation

◆ bestDualBoundValue

◆ candidateOfCollecting

bool candidateOfCollecting
private

◆ collectingIsProhibited

◆ collectingMode

◆ collectingModeSolverHeapElement

BbParaSolverPoolElementPtr* collectingModeSolverHeapElement
private

pointer to collecting mode heap element

the following values are used to make decision for load balancing

Definition at line 76 of file bbParaSolverPool.h.

Referenced by BbParaSolverPoolElement::getCollectingModeSolverHeapElement(), and BbParaSolverPoolElement::setCollectingModeSolverHeapElement().

◆ currentNode

◆ dualBoundGainTesting

bool dualBoundGainTesting
private

◆ generator

bool generator
private

this Solver can generate subproblems

Definition at line 70 of file bbParaSolverPool.h.

Referenced by BbParaSolverPoolElement::isGenerator(), and BbParaSolverPoolElement::setNoGenerator().

◆ numOfDiffNodesLeft

int numOfDiffNodesLeft
private

number of nodes left difference between current number and that in the previous notification time

Definition at line 85 of file bbParaSolverPool.h.

Referenced by BbParaSolverPoolElement::died(), BbParaSolverPoolElement::getNumOfDiffNodesLeft(), BbParaSolverPoolElement::inactivate(), and BbParaSolverPoolElement::setNumOfDiffNodesLeft().

◆ numOfDiffNodesSolved

int numOfDiffNodesSolved
private

number of nodes solved difference between current number and that in the previous notification time

Definition at line 82 of file bbParaSolverPool.h.

Referenced by BbParaSolverPoolElement::getNumOfDiffNodesSolved(), and BbParaSolverPoolElement::setNumOfDiffNodesSolved().

◆ numOfNodesLeft

◆ numOfNodesSolved

long long numOfNodesSolved
private

◆ rank

int rank
private

rank of the Solver

Definition at line 66 of file bbParaSolverPool.h.

Referenced by BbParaSolverPoolElement::getRank().

◆ selectionHeapElement

BbParaSolverPoolElementPtr* selectionHeapElement
private

pointer to selection heap element

Definition at line 75 of file bbParaSolverPool.h.

Referenced by BbParaSolverPoolElement::getSelectionHeapElement(), and BbParaSolverPoolElement::setSelectionHeapElement().

◆ selfSplitNodes

◆ status

◆ termState

ParaSolverTerminationState* termState
private

Solver termination statistics: for checkpoint.

Definition at line 88 of file bbParaSolverPool.h.

Referenced by BbParaSolverPoolElement::getTermState(), BbParaSolverPoolElement::setTermState(), and BbParaSolverPoolElement::~BbParaSolverPoolElement().