class Selection Heap More...
#include <bbParaSolverPool.h>
Public Types | |
enum | ResultOfInsert { SUCCEEDED , FAILED_BY_FULL } |
results of insert More... | |
Public Member Functions | |
SelectionHeap (std::size_t size) | |
constructor More... | |
virtual | ~SelectionHeap () |
destructor More... | |
ResultOfInsert | insert (BbParaSolverPoolElementPtr solver) |
insert BbParaSolverPoolElementPtr to Selection Heap More... | |
BbParaSolverPoolElementPtr | top () const |
obtain top priority BbParaSolverPoolElementPtr More... | |
BbParaSolverPoolElementPtr | get (int i) const |
obtain i-th in heap BbParaSolverPoolElementPtr More... | |
BbParaSolverPoolElementPtr | remove () |
remove top priority BbParaSolverPoolElementPtr from Selection Heap More... | |
void | resize (std::size_t size) |
resize Selection Heap More... | |
std::size_t | getHeapSize () const |
get current used heap size More... | |
std::size_t | getMaxHeapSize () const |
get max heap size More... | |
virtual void | updateDualBoundValue (BbParaSolverPoolElementPtr solver, double value)=0 |
update selection heap by a new dual bound value of this Solver More... | |
virtual void | deleteElement (BbParaSolverPoolElementPtr solver)=0 |
delete BbParaSolverPoolElementPtr from Selection Heap More... | |
virtual void | upHeap (std::size_t pos)=0 |
up heap More... | |
virtual void | downHeap (std::size_t pos)=0 |
down heap More... | |
const std::string | toString () |
stringfy of this object for debugging More... | |
Protected Attributes | |
std::size_t | maxHeapSize |
maximum size of this heap More... | |
std::size_t | heapSize |
current used heap size More... | |
BbParaSolverPoolElementPtr * | heap |
heap : contents are BbParaSolverPoolElementPtr More... | |
class Selection Heap
Definition at line 865 of file bbParaSolverPool.h.
enum ResultOfInsert |
results of insert
Enumerator | |
---|---|
SUCCEEDED | SUCCEEDED. |
FAILED_BY_FULL | FAILED_BY_FULL. |
Definition at line 873 of file bbParaSolverPool.h.
SelectionHeap | ( | std::size_t | size | ) |
constructor
constructor of selection heap
size | heap size |
Definition at line 53 of file bbParaSolverPool.cpp.
References SelectionHeap::heap, SelectionHeap::heapSize, and SelectionHeap::maxHeapSize.
|
virtual |
destructor
destructor of selection heap
Definition at line 63 of file bbParaSolverPool.cpp.
References SelectionHeap::heap.
|
pure virtual |
delete BbParaSolverPoolElementPtr from Selection Heap
solver | Solver pool element to be deleted |
Implemented in DescendingSelectionHeap, and AscendingSelectionHeap.
Referenced by BbParaSolverPool::inactivateSolver(), BbParaSolverPool::resetCountersInSolver(), and BbParaSolverPool::solverDied().
|
pure virtual |
down heap
pos | start position to down heap |
Implemented in DescendingSelectionHeap, and AscendingSelectionHeap.
Referenced by SelectionHeap::remove().
BbParaSolverPoolElementPtr get | ( | int | i | ) | const |
obtain i-th in heap BbParaSolverPoolElementPtr
Definition at line 914 of file bbParaSolverPool.h.
References SelectionHeap::heap.
Referenced by BbParaSolverPool::getGoodSolverSolvingEssentialNode().
std::size_t getHeapSize | ( | ) | const |
get current used heap size
Definition at line 939 of file bbParaSolverPool.h.
References SelectionHeap::heapSize.
Referenced by BbParaSolverPool::getBestSolver(), BbParaSolverPoolForMinimization::getGlobalBestDualBoundValue(), BbParaRacingSolverPool::getGlobalBestDualBoundValue(), BbParaSolverPool::getGoodSolverSolvingEssentialNode(), BbParaSolverPool::getNumOfNodesLeftInBestSolver(), and BbParaRacingSolverPool::updateSolverStatus().
std::size_t getMaxHeapSize | ( | ) | const |
get max heap size
Definition at line 949 of file bbParaSolverPool.h.
References SelectionHeap::maxHeapSize.
SelectionHeap::ResultOfInsert insert | ( | BbParaSolverPoolElementPtr | inSolver | ) |
insert BbParaSolverPoolElementPtr to Selection Heap
insert BbParaSolverPoolElementPtr to selection heap
inSolver | Solver pool element to be inserted |
Definition at line 84 of file bbParaSolverPool.cpp.
References SelectionHeap::FAILED_BY_FULL, SelectionHeap::heap, SelectionHeap::heapSize, SelectionHeap::maxHeapSize, SelectionHeap::SUCCEEDED, and SelectionHeap::upHeap().
Referenced by BbParaRacingSolverPool::activate(), and BbParaSolverPool::activateSolver().
BbParaSolverPoolElementPtr remove | ( | ) |
remove top priority BbParaSolverPoolElementPtr from Selection Heap
remove the top priority element form selection heap
Definition at line 96 of file bbParaSolverPool.cpp.
References SelectionHeap::downHeap(), SelectionHeap::heap, SelectionHeap::heapSize, and BbParaSolverPoolElement::setSelectionHeapElement().
void resize | ( | std::size_t | size | ) |
resize Selection Heap
resize selection heap
size | new size |
Definition at line 70 of file bbParaSolverPool.cpp.
References SelectionHeap::heap, and SelectionHeap::maxHeapSize.
BbParaSolverPoolElementPtr top | ( | ) | const |
obtain top priority BbParaSolverPoolElementPtr
Definition at line 904 of file bbParaSolverPool.h.
References SelectionHeap::heap.
Referenced by BbParaSolverPool::getBestSolver(), BbParaSolverPoolForMinimization::getGlobalBestDualBoundValue(), BbParaSolverPool::getNumOfNodesLeftInBestSolver(), BbParaSolverPool::inactivateSolver(), BbParaRacingSolverPool::isWinnerDecided(), BbParaSolverPool::resetCountersInSolver(), BbParaSolverPoolForMinimization::switchInCollectingMode(), BbParaRacingSolverPool::updateSolverStatus(), and BbParaSolverPoolForMinimization::updateSolverStatus().
const std::string toString | ( | ) |
stringfy of this object for debugging
stringfy selection heap
Definition at line 115 of file bbParaSolverPool.cpp.
References BbParaSolverPoolElement::getNumOfDiffNodesLeft(), BbParaSolverPoolElement::getNumOfNodesLeft(), BbParaSolverPoolElement::getRank(), BbParaSolverPoolElement::getStatus(), SelectionHeap::heap, SelectionHeap::heapSize, BbParaSolverPoolElement::isInCollectingMode(), and SelectionHeap::maxHeapSize.
Referenced by BbParaSolverPoolForMinimization::updateSolverStatus().
|
pure virtual |
update selection heap by a new dual bound value of this Solver
solver | Solver pool element to be updated |
value | dual bound value |
Implemented in DescendingSelectionHeap, and AscendingSelectionHeap.
Referenced by BbParaRacingSolverPool::updateSolverStatus(), and BbParaSolverPoolForMinimization::updateSolverStatus().
|
pure virtual |
up heap
pos | start position to up heap |
Implemented in DescendingSelectionHeap, and AscendingSelectionHeap.
Referenced by SelectionHeap::insert().
|
protected |
heap : contents are BbParaSolverPoolElementPtr
Definition at line 999 of file bbParaSolverPool.h.
Referenced by DescendingSelectionHeap::deleteElement(), AscendingSelectionHeap::deleteElement(), DescendingSelectionHeap::downHeap(), AscendingSelectionHeap::downHeap(), SelectionHeap::get(), SelectionHeap::insert(), SelectionHeap::remove(), SelectionHeap::resize(), SelectionHeap::SelectionHeap(), SelectionHeap::top(), SelectionHeap::toString(), DescendingSelectionHeap::updateDualBoundValue(), AscendingSelectionHeap::updateDualBoundValue(), DescendingSelectionHeap::upHeap(), AscendingSelectionHeap::upHeap(), and SelectionHeap::~SelectionHeap().
|
protected |
current used heap size
Definition at line 997 of file bbParaSolverPool.h.
Referenced by DescendingSelectionHeap::deleteElement(), AscendingSelectionHeap::deleteElement(), DescendingSelectionHeap::downHeap(), AscendingSelectionHeap::downHeap(), SelectionHeap::getHeapSize(), SelectionHeap::insert(), SelectionHeap::remove(), SelectionHeap::SelectionHeap(), and SelectionHeap::toString().
|
protected |
maximum size of this heap
Definition at line 996 of file bbParaSolverPool.h.
Referenced by SelectionHeap::getMaxHeapSize(), SelectionHeap::insert(), SelectionHeap::resize(), SelectionHeap::SelectionHeap(), and SelectionHeap::toString().