Class for initiator. More...
#include <bbParaInitiator.h>
Public Member Functions | |
| BbParaInitiator (ParaComm *inComm, ParaTimer *inTimer) | |
| constructor More... | |
| virtual | ~BbParaInitiator () |
| destructor More... | |
| BbParaNode * | readParaNodeFromCheckpointFile (bool onlyBoundChanges) |
| read a ParaNode from checkpoint file More... | |
| bool | isSolvedAtInit () |
| check if problem is solved at init or not More... | |
| bool | isSolvedAtReInit () |
| check if problem is solved at reInit or not More... | |
| void | setTightenedVarLbs (int i, double v) |
| set tightened variable lower bound TODO: this function should be in inherited class More... | |
| void | setTightenedVarUbs (int i, double v) |
| set tightened variable upper bound TODO: this function should be in inherited class More... | |
| double | getTightenedVarLbs (int i) |
| get tightened variable lower bound TODO: this function should be in inherited class More... | |
| double | getTightenedVarUbs (int i) |
| get tightened variable upper bound TODO: this function should be in inherited class More... | |
| bool | areTightenedVarBounds () |
| check if there are tightened lower or upper bound TODO: this function should be in inherited class More... | |
| virtual BbParaDiffSubproblem * | makeRootNodeDiffSubproblem ()=0 |
| make DiffSubproblem object for root node More... | |
| virtual double | convertToExternalValue (double internalValue)=0 |
| convert objective function value to external value TODO: this function may be in inherited class More... | |
| virtual BbParaSolution * | getGlobalBestIncumbentSolution ()=0 |
| get global best incumbent solution More... | |
| virtual int | getNSolutions ()=0 |
| get the number of incumbent solutions More... | |
| virtual bool | tryToSetIncumbentSolution (BbParaSolution *sol, bool checksol)=0 |
| try to set incumbent solution More... | |
| virtual double | getAbsgap (double dualBoundValue)=0 |
| get absolute gap of dual bound value More... | |
| virtual double | getGap (double dualBoundValue)=0 |
| get relative gap of dual bound value More... | |
| virtual double | getAbsgapValue ()=0 |
| get absgap value specified More... | |
| virtual double | getGapValue ()=0 |
| get gap value specified More... | |
| virtual void | setFinalSolverStatus (FinalSolverState status)=0 |
| set final solver status More... | |
| virtual void | setNumberOfNodesSolved (long long n)=0 |
| set number of nodes solved More... | |
| virtual void | setDualBound (double bound)=0 |
| set final dual bound More... | |
| virtual bool | isFeasibleSolution ()=0 |
| check if feasible solution exists or not More... | |
| virtual void | accumulateInitialStat (ParaInitialStat *initialStat) |
| accumulate initial status More... | |
| virtual void | setInitialStatOnDiffSubproblem (int minDepth, int maxDepth, BbParaDiffSubproblem *diffSubproblem) |
| set initial status on DiffSubproblem More... | |
| virtual bool | isObjIntegral () |
| check if objective function value is always integral or not More... | |
| virtual bool | canGenerateSpecialCutOffValue () |
| check if solver can generate special cut off value or not More... | |
Public Member Functions inherited from ParaInitiator | |
| ParaInitiator (ParaComm *inComm, ParaTimer *inTimer) | |
| constructor More... | |
| virtual | ~ParaInitiator () |
| destructor More... | |
| bool | isWarmStarted () |
| check if the execution is warm started (restarted) or not More... | |
| const char * | getPrefixWarm () |
| get prefix of warm start (restart) files More... | |
| ParaComm * | getParaComm () |
| get communicator being used More... | |
| virtual int | init (ParaParamSet *params, int argc, char **argv)=0 |
| initialize initiator More... | |
| virtual int | reInit (int nRestartedRacing)=0 |
| reinitizalie initiator TODO: this function should be in inherited class More... | |
| virtual ParaInstance * | getParaInstance ()=0 |
| get instance object More... | |
| virtual void | sendSolverInitializationMessage ()=0 |
| send solver initialization message More... | |
| virtual void | generateRacingRampUpParameterSets (int nParamSets, ParaRacingRampUpParamSet **racingRampUpParamSets)=0 |
| generate racing ramp-up parameter sets TODO: this function may be in inherited class More... | |
| virtual double | getEpsilon ()=0 |
| get epsilon specified More... | |
| virtual void | writeSolution (const std::string &message)=0 |
| write solution More... | |
| virtual void | writeParaInstance (const std::string &filename)=0 |
| write ParaInstance More... | |
| virtual void | writeCheckpointSolution (const std::string &filename)=0 |
| write checkpoint solution More... | |
| virtual double | readSolutionFromCheckpointFile (char *afterCheckpointingSolutionFileName)=0 |
| read solution from checkpoint file More... | |
| virtual void | writeSolverParameters (std::ostream *os)=0 |
| write solver runtime parameters More... | |
| virtual void | outputFinalSolverStatistics (std::ostream *os, double time)=0 |
| output final solver statistics More... | |
| virtual std::string | getStatus ()=0 |
| get solving status string More... | |
| virtual void | printSolverVersion (std::ostream *os)=0 |
| print solver version More... | |
Protected Attributes | |
| bool | solvedAtInit |
| solved at init More... | |
| bool | solvedAtReInit |
| solved at reInit More... | |
| double * | tightenedVarLbs |
| array of tightened lower bound of variable More... | |
| double * | tightenedVarUbs |
| array of tightened upper bound of variable More... | |
| gzstream::igzstream | checkpointTasksStream |
| gzstream for checkpoint tasks file More... | |
Protected Attributes inherited from ParaInitiator | |
| ParaComm * | paraComm |
| communicator used More... | |
| ParaTimer * | timer |
| timer used More... | |
| char * | prefixWarm |
| prefix of warm start files More... | |
Class for initiator.
Definition at line 74 of file bbParaInitiator.h.
| BbParaInitiator | ( | ParaComm * | inComm, |
| ParaTimer * | inTimer | ||
| ) |
constructor
| inComm | communicator used |
| inTimer | timer used |
Definition at line 93 of file bbParaInitiator.h.
|
virtual |
destructor
Definition at line 108 of file bbParaInitiator.h.
References BbParaInitiator::tightenedVarLbs, and BbParaInitiator::tightenedVarUbs.
|
virtual |
accumulate initial status
| initialStat | initial status collected |
Reimplemented in ScipParaInitiator.
Definition at line 344 of file bbParaInitiator.h.
| bool areTightenedVarBounds | ( | ) |
check if there are tightened lower or upper bound TODO: this function should be in inherited class
Definition at line 235 of file bbParaInitiator.h.
References BbParaInitiator::tightenedVarLbs, and BbParaInitiator::tightenedVarUbs.
Referenced by ScipParaDiffSubproblem::createDiffSubproblem().
|
virtual |
check if solver can generate special cut off value or not
Definition at line 375 of file bbParaInitiator.h.
Referenced by BbParaLoadCoordinator::processTagSolution().
|
pure virtual |
convert objective function value to external value TODO: this function may be in inherited class
| internalValue | internal value of the objective function |
Implemented in ScipParaInitiator.
Referenced by BbParaLoadCoordinator::outputTabularSolvingStatus(), BbParaLoadCoordinator::processRacingRampUpTagCompletionOfCalculation(), BbParaLoadCoordinator::processRacingRampUpTagSolverState(), BbParaLoadCoordinator::processTagAnotherNodeRequest(), BbParaLoadCoordinator::processTagCompletionOfCalculation(), BbParaLoadCoordinator::processTagNewSubtreeRootNode(), BbParaLoadCoordinator::processTagReassignSelfSplitSubtreeRootNode(), BbParaLoadCoordinator::processTagSelfSlpitNodeCalcuationState(), BbParaLoadCoordinator::processTagSolution(), BbParaLoadCoordinator::processTagSolverState(), BbParaLoadCoordinator::processTagSubtreeRootNodeToBeRemoved(), BbParaLoadCoordinator::processTagTask(), BbParaLoadCoordinator::run(), BbParaLoadCoordinator::sendParaTasksToIdleSolvers(), BbParaLoadCoordinator::warmStart(), and BbParaLoadCoordinator::~BbParaLoadCoordinator().
|
pure virtual |
get absolute gap of dual bound value
| dualBoundValue | dual bound value |
Implemented in ScipParaInitiator.
Referenced by BbParaLoadCoordinator::processRacingRampUpTagSolverState(), BbParaLoadCoordinator::processTagCompletionOfCalculation(), BbParaLoadCoordinator::processTagSolverState(), and BbParaLoadCoordinator::sendParaTasksToIdleSolvers().
|
pure virtual |
get absgap value specified
Implemented in ScipParaInitiator.
Referenced by BbParaLoadCoordinator::processRacingRampUpTagSolverState(), BbParaLoadCoordinator::processTagCompletionOfCalculation(), BbParaLoadCoordinator::processTagSolverState(), and BbParaLoadCoordinator::sendParaTasksToIdleSolvers().
|
pure virtual |
get relative gap of dual bound value
| dualBoundValue | dual bound value |
Implemented in ScipParaInitiator.
Referenced by BbParaLoadCoordinator::outputTabularSolvingStatus(), BbParaLoadCoordinator::processRacingRampUpTagSolverState(), BbParaLoadCoordinator::processTagAnotherNodeRequest(), BbParaLoadCoordinator::processTagCompletionOfCalculation(), BbParaLoadCoordinator::processTagSolverState(), BbParaLoadCoordinator::run(), and BbParaLoadCoordinator::sendParaTasksToIdleSolvers().
|
pure virtual |
get gap value specified
Implemented in ScipParaInitiator.
Referenced by BbParaLoadCoordinator::processRacingRampUpTagSolverState(), BbParaLoadCoordinator::processTagCompletionOfCalculation(), BbParaLoadCoordinator::processTagSolverState(), and BbParaLoadCoordinator::sendParaTasksToIdleSolvers().
|
pure virtual |
get global best incumbent solution
Implemented in ScipParaInitiator.
Referenced by BbParaLoadCoordinator::outputTabularSolvingStatus(), BbParaLoadCoordinator::processRacingRampUpTagCompletionOfCalculation(), BbParaLoadCoordinator::processRacingRampUpTagSolverState(), BbParaLoadCoordinator::processTagAnotherNodeRequest(), BbParaLoadCoordinator::processTagCompletionOfCalculation(), BbParaLoadCoordinator::processTagSelfSlpitNodeCalcuationState(), BbParaLoadCoordinator::processTagSolution(), BbParaLoadCoordinator::processTagSolverState(), BbParaLoadCoordinator::processTagTask(), BbParaLoadCoordinator::run(), BbParaLoadCoordinator::sendCutOffValue(), BbParaLoadCoordinator::sendIncumbentValue(), BbParaLoadCoordinator::sendParaTasksToIdleSolvers(), BbParaLoadCoordinator::updateSolution(), BbParaLoadCoordinator::warmStart(), and BbParaLoadCoordinator::~BbParaLoadCoordinator().
|
pure virtual |
get the number of incumbent solutions
Implemented in ScipParaInitiator.
Referenced by BbParaLoadCoordinator::processRacingRampUpTagCompletionOfCalculation().
| double getTightenedVarLbs | ( | int | i | ) |
get tightened variable lower bound TODO: this function should be in inherited class
| i | index of variable |
Definition at line 197 of file bbParaInitiator.h.
References BbParaInitiator::tightenedVarLbs.
Referenced by ScipParaDiffSubproblem::createDiffSubproblem().
| double getTightenedVarUbs | ( | int | i | ) |
get tightened variable upper bound TODO: this function should be in inherited class
| i | index of variable |
Definition at line 216 of file bbParaInitiator.h.
References BbParaInitiator::tightenedVarUbs.
Referenced by ScipParaDiffSubproblem::createDiffSubproblem().
|
pure virtual |
check if feasible solution exists or not
Implemented in ScipParaInitiator.
|
virtual |
check if objective function value is always integral or not
Reimplemented in ScipParaInitiator.
Definition at line 365 of file bbParaInitiator.h.
Referenced by BbParaLoadCoordinator::sendParaTasksToIdleSolvers().
| bool isSolvedAtInit | ( | ) |
check if problem is solved at init or not
Definition at line 146 of file bbParaInitiator.h.
References BbParaInitiator::solvedAtInit.
| bool isSolvedAtReInit | ( | ) |
check if problem is solved at reInit or not
Definition at line 156 of file bbParaInitiator.h.
References BbParaInitiator::solvedAtReInit.
|
pure virtual |
make DiffSubproblem object for root node
Implemented in ScipParaInitiator.
Referenced by BbParaLoadCoordinator::run().
| BbParaNode * readParaNodeFromCheckpointFile | ( | bool | onlyBoundChanges | ) |
read a ParaNode from checkpoint file
| onlyBoundChanges | indicate if it read only bound changes of not. true: only bound changes, fase: else |
Definition at line 121 of file bbParaInitiator.h.
References BbParaInitiator::checkpointTasksStream, ParaComm::createParaTask(), ParaInitiator::paraComm, and BbParaNode::read().
Referenced by BbParaLoadCoordinator::warmStart().
|
pure virtual |
set final dual bound
| bound | dual bound value |
Implemented in ScipParaInitiator.
Referenced by BbParaLoadCoordinator::~BbParaLoadCoordinator().
|
pure virtual |
set final solver status
| status | solver status |
Implemented in ScipParaInitiator.
Referenced by BbParaLoadCoordinator::~BbParaLoadCoordinator().
|
virtual |
set initial status on DiffSubproblem
| minDepth | minimum depth |
| maxDepth | maximum depth |
| diffSubproblem | pointer to ParaDiffSubproblem object |
Reimplemented in ScipParaInitiator.
Definition at line 353 of file bbParaInitiator.h.
Referenced by BbParaLoadCoordinator::sendParaTasksToIdleSolvers().
|
pure virtual |
set number of nodes solved
| n | the number of nodes solved |
Implemented in ScipParaInitiator.
Referenced by BbParaLoadCoordinator::~BbParaLoadCoordinator().
| void setTightenedVarLbs | ( | int | i, |
| double | v | ||
| ) |
set tightened variable lower bound TODO: this function should be in inherited class
| i | index of variable |
| v | tightened bound |
Definition at line 166 of file bbParaInitiator.h.
References BbParaInitiator::tightenedVarLbs.
| void setTightenedVarUbs | ( | int | i, |
| double | v | ||
| ) |
set tightened variable upper bound TODO: this function should be in inherited class
| i | index of variable |
| v | tightened bound |
Definition at line 181 of file bbParaInitiator.h.
References BbParaInitiator::tightenedVarUbs.
|
pure virtual |
try to set incumbent solution
| sol | pointer to ParaSolution object to be set |
| checksol | true if the solution feasibility need to be checked |
Implemented in ScipParaInitiator.
Referenced by BbParaLoadCoordinator::updateSolution().
|
protected |
gzstream for checkpoint tasks file
Definition at line 85 of file bbParaInitiator.h.
Referenced by ScipParaInitiator::init(), and BbParaInitiator::readParaNodeFromCheckpointFile().
|
protected |
solved at init
Definition at line 79 of file bbParaInitiator.h.
Referenced by ScipParaInitiator::init(), BbParaInitiator::isSolvedAtInit(), and ScipParaInitiator::writeSolution().
|
protected |
solved at reInit
Definition at line 80 of file bbParaInitiator.h.
Referenced by BbParaInitiator::isSolvedAtReInit(), and ScipParaInitiator::reInit().
|
protected |
array of tightened lower bound of variable
Definition at line 81 of file bbParaInitiator.h.
Referenced by BbParaInitiator::areTightenedVarBounds(), BbParaInitiator::getTightenedVarLbs(), ScipParaInitiator::sendSolverInitializationMessage(), BbParaInitiator::setTightenedVarLbs(), and BbParaInitiator::~BbParaInitiator().
|
protected |
array of tightened upper bound of variable
Definition at line 82 of file bbParaInitiator.h.
Referenced by BbParaInitiator::areTightenedVarBounds(), BbParaInitiator::getTightenedVarUbs(), ScipParaInitiator::sendSolverInitializationMessage(), BbParaInitiator::setTightenedVarUbs(), and BbParaInitiator::~BbParaInitiator().