Scippy

UG

Ubiquity Generator framework

BbParaInitiator Class Referenceabstract

Class for initiator. More...

#include <bbParaInitiator.h>

+ Inheritance diagram for BbParaInitiator:

Public Member Functions

 BbParaInitiator (ParaComm *inComm, ParaTimer *inTimer)
 constructor More...
 
virtual ~BbParaInitiator ()
 destructor 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 BbParaDiffSubproblemmakeRootNodeDiffSubproblem ()=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 BbParaSolutiongetGlobalBestIncumbentSolution ()=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...
 
ParaCommgetParaComm ()
 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 ParaInstancegetParaInstance ()=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 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...
 
- Protected Attributes inherited from ParaInitiator
ParaCommparaComm
 communicator used More...
 
ParaTimertimer
 timer used More...
 
char * prefixWarm
 prefix of warm start files More...
 

Detailed Description

Class for initiator.

Definition at line 74 of file bbParaInitiator.h.

Constructor & Destructor Documentation

◆ BbParaInitiator()

BbParaInitiator ( ParaComm inComm,
ParaTimer inTimer 
)

constructor

Parameters
inCommcommunicator used
inTimertimer used

Definition at line 93 of file bbParaInitiator.h.

◆ ~BbParaInitiator()

Member Function Documentation

◆ accumulateInitialStat()

virtual void accumulateInitialStat ( ParaInitialStat initialStat)
virtual

accumulate initial status

Parameters
initialStatinitial status collected

Reimplemented in ScipParaInitiator.

Definition at line 344 of file bbParaInitiator.h.

◆ areTightenedVarBounds()

◆ canGenerateSpecialCutOffValue()

virtual bool canGenerateSpecialCutOffValue ( )
virtual

check if solver can generate special cut off value or not

Returns
true if it can be generated, false others

Definition at line 375 of file bbParaInitiator.h.

Referenced by BbParaLoadCoordinator::processTagSolution().

◆ convertToExternalValue()

◆ getAbsgap()

virtual double getAbsgap ( double  dualBoundValue)
pure virtual

get absolute gap of dual bound value

Returns
absolute gap
Parameters
dualBoundValuedual bound value

Implemented in ScipParaInitiator.

Referenced by BbParaInitiator::areTightenedVarBounds(), BbParaLoadCoordinator::processTagCompletionOfCalculation(), BbParaLoadCoordinator::processTagSolverState(), and BbParaLoadCoordinator::sendParaTasksToIdleSolvers().

◆ getAbsgapValue()

◆ getGap()

virtual double getGap ( double  dualBoundValue)
pure virtual

◆ getGapValue()

◆ getGlobalBestIncumbentSolution()

◆ getNSolutions()

virtual int getNSolutions ( )
pure virtual

get the number of incumbent solutions

Returns
the number of incumbent solutions

Implemented in ScipParaInitiator.

Referenced by BbParaInitiator::areTightenedVarBounds().

◆ getTightenedVarLbs()

double getTightenedVarLbs ( int  i)

get tightened variable lower bound TODO: this function should be in inherited class

Returns
lower bound
Parameters
iindex of variable

Definition at line 197 of file bbParaInitiator.h.

Referenced by ScipParaDiffSubproblem::createDiffSubproblem().

◆ getTightenedVarUbs()

double getTightenedVarUbs ( int  i)

get tightened variable upper bound TODO: this function should be in inherited class

Returns
uppper bound
Parameters
iindex of variable

Definition at line 216 of file bbParaInitiator.h.

Referenced by ScipParaDiffSubproblem::createDiffSubproblem().

◆ isFeasibleSolution()

virtual bool isFeasibleSolution ( )
pure virtual

check if feasible solution exists or not

Returns
true if a feasible solution exists, false otherwise

Implemented in ScipParaInitiator.

Referenced by BbParaInitiator::areTightenedVarBounds().

◆ isObjIntegral()

virtual bool isObjIntegral ( )
virtual

check if objective function value is always integral or not

Returns
true if it is always integral, false others

Reimplemented in ScipParaInitiator.

Definition at line 365 of file bbParaInitiator.h.

Referenced by BbParaLoadCoordinator::sendParaTasksToIdleSolvers().

◆ isSolvedAtInit()

bool isSolvedAtInit ( )

check if problem is solved at init or not

Returns
true if problem is solved, false otherwise

Definition at line 146 of file bbParaInitiator.h.

References BbParaInitiator::solvedAtInit.

◆ isSolvedAtReInit()

bool isSolvedAtReInit ( )

check if problem is solved at reInit or not

Returns
true if problem is solved, false otherwise

Definition at line 156 of file bbParaInitiator.h.

References BbParaInitiator::solvedAtReInit.

◆ makeRootNodeDiffSubproblem()

virtual BbParaDiffSubproblem* makeRootNodeDiffSubproblem ( )
pure virtual

make DiffSubproblem object for root node

Returns
pointer to the root ParaDiffSubproblem object

Implemented in ScipParaInitiator.

Referenced by BbParaInitiator::areTightenedVarBounds(), and BbParaLoadCoordinator::run().

◆ setDualBound()

virtual void setDualBound ( double  bound)
pure virtual

set final dual bound

Parameters
bounddual bound value

Implemented in ScipParaInitiator.

Referenced by BbParaInitiator::areTightenedVarBounds(), and BbParaLoadCoordinator::~BbParaLoadCoordinator().

◆ setFinalSolverStatus()

virtual void setFinalSolverStatus ( FinalSolverState  status)
pure virtual

set final solver status

Parameters
statussolver status

Implemented in ScipParaInitiator.

Referenced by BbParaInitiator::areTightenedVarBounds(), and BbParaLoadCoordinator::~BbParaLoadCoordinator().

◆ setInitialStatOnDiffSubproblem()

virtual void setInitialStatOnDiffSubproblem ( int  minDepth,
int  maxDepth,
BbParaDiffSubproblem diffSubproblem 
)
virtual

set initial status on DiffSubproblem

Parameters
minDepthminimum depth
maxDepthmaximum depth
diffSubproblempointer to ParaDiffSubproblem object

Reimplemented in ScipParaInitiator.

Definition at line 353 of file bbParaInitiator.h.

Referenced by BbParaLoadCoordinator::sendParaTasksToIdleSolvers().

◆ setNumberOfNodesSolved()

virtual void setNumberOfNodesSolved ( long long  n)
pure virtual

set number of nodes solved

Parameters
nthe number of nodes solved

Implemented in ScipParaInitiator.

Referenced by BbParaInitiator::areTightenedVarBounds(), and BbParaLoadCoordinator::~BbParaLoadCoordinator().

◆ setTightenedVarLbs()

void setTightenedVarLbs ( int  i,
double  v 
)

set tightened variable lower bound TODO: this function should be in inherited class

Parameters
iindex of variable
vtightened bound

Definition at line 166 of file bbParaInitiator.h.

◆ setTightenedVarUbs()

void setTightenedVarUbs ( int  i,
double  v 
)

set tightened variable upper bound TODO: this function should be in inherited class

Parameters
iindex of variable
vtightened bound

Definition at line 181 of file bbParaInitiator.h.

◆ tryToSetIncumbentSolution()

virtual bool tryToSetIncumbentSolution ( BbParaSolution sol,
bool  checksol 
)
pure virtual

try to set incumbent solution

Returns
true if solution is set successfully, false otherwise
Parameters
solpointer to ParaSolution object to be set
checksoltrue if the solution feasibility need to be checked

Implemented in ScipParaInitiator.

Referenced by BbParaInitiator::areTightenedVarBounds(), and BbParaLoadCoordinator::updateSolution().

Member Data Documentation

◆ solvedAtInit

bool solvedAtInit
protected

solved at init

Definition at line 79 of file bbParaInitiator.h.

Referenced by BbParaInitiator::isSolvedAtInit().

◆ solvedAtReInit

bool solvedAtReInit
protected

solved at reInit

Definition at line 80 of file bbParaInitiator.h.

Referenced by BbParaInitiator::isSolvedAtReInit().

◆ tightenedVarLbs

double* tightenedVarLbs
protected

array of tightened lower bound of variable

Definition at line 81 of file bbParaInitiator.h.

Referenced by BbParaInitiator::~BbParaInitiator().

◆ tightenedVarUbs

double* tightenedVarUbs
protected

array of tightened upper bound of variable

Definition at line 82 of file bbParaInitiator.h.

Referenced by BbParaInitiator::~BbParaInitiator().