37#ifndef __SCIP_PARA_INITIATOR_H__
38#define __SCIP_PARA_INITIATOR_H__
49#include "objscip/objscip.h"
51#include "scip/scipdefplugins.h"
53#include "ugs/ugsParaCommMpi.h"
126#ifndef SCIP_THREADSAFE_MESSAGEHDLRS
129 SCIP_CALL_ABORT( SCIPsetDefaultMessagehdlr() );
130 SCIP_CALL_ABORT( SCIPfreeObjMessagehdlr(&
messagehdlr) );
150 SCIP_CALL_ABORT( SCIPprintStatistics(
scip, NULL) );
154 SCIP_CALL_ABORT( SCIPfree(&
scip) );
160 BMScheckEmptyMemory();
205 return SCIPgetNSols(
scip);
235 double getGap(
double dualBoundValue);
242 SCIP_CALL_ABORT( SCIPgetRealParam(
scip,
"limits/absgap",&
absgap ) );
251 SCIP_CALL_ABORT( SCIPgetRealParam(inScip,
"limits/absgap",&gapValue ) );
261 SCIP_CALL_ABORT( SCIPgetRealParam(
scip,
"limits/gap",&
gap ) );
270 SCIP_CALL_ABORT( SCIPgetRealParam(inScip,
"limits/gap",&gapValue ) );
303 return ( SCIPgetBestSol(
scip) != NULL );
338 (*userPlugins)(inScip, inLogname, inQuiet, inComment);
347 SCIP_STAGE stage = SCIPgetStage(
scip);
349 if(stage == SCIP_STAGE_PRESOLVING || stage == SCIP_STAGE_SOLVING)
350 SCIP_CALL_ABORT( SCIPinterruptSolve(
scip) );
365 if( i < SCIPgetNVars(
scip) )
389 if( i < SCIPgetNVars(
scip) )
412 assert( i < SCIPgetNVars(
scip) );
432 assert( i < SCIPgetNVars(
scip) );
445 bool readUgsIncumbentSolution(UGS::UgsParaCommMpi *ugsComm,
int source);
448 void writeUgsIncumbentSolution(UGS::UgsParaCommMpi *ugsComm);
Base class of initiator that maintains original problem and incumbent solution.
void sendSolverInitializationMessage()
double getTightenedVarLbs(int i)
get tightened variable lower bound TODO: this function should be in inherited class
bool tryToSetIncumbentSolution(UG::BbParaSolution *sol, bool checksol)
double convertToInternalValue(double externalValue)
void outputFinalSolverStatistics(std::ostream *os, double time)
void generateRacingRampUpParameterSets(int nParamSets, UG::ParaRacingRampUpParamSet **racingRampUpParamSets)
void writeSolverParameters(std::ostream *os)
void writeSolution(const std::string &message)
UG::BbParaSolution * getGlobalBestIncumbentSolution()
UG::BbParaDiffSubproblem * makeRootNodeDiffSubproblem()
void writeCheckpointSolution(const std::string &filename)
char * racingSettingsName
ScipParaInitiator(UG::ParaComm *inComm, UG::ParaTimer *inTimer)
double getTightenedVarUbs(int i)
get tightened variable upper bound TODO: this function should be in inherited class
double getAbsgapValue(SCIP *inScip)
SCIP_MESSAGEHDLR * messagehdlr
void setInitialStatOnDiffSubproblem(int minDepth, int maxDepth, UG::BbParaDiffSubproblem *diffSubproblem)
double getGap(double dualBoundValue)
bool isFeasibleSolution()
double readSolutionFromCheckpointFile(char *afterCheckpointingSolutionFileName)
ScipDiffParamSet * scipDiffParamSet
bool setTightenedVarLbs(int i, double v)
set tightened variable lower bound TODO: this function should be in inherited class
UG::ParaInstance * getParaInstance()
void printSolverVersion(std::ostream *os)
double getAbsgap(double dualBoundValue)
double convertToExternalValue(double internalValue)
ScipUserPlugins * userPlugins
bool setTightenedVarUbs(int i, double v)
set tightened variable upper bound TODO: this function should be in inherited class
void writeParaInstance(const std::string &filename)
void setDualBound(double bound)
void setFinalSolverStatus(UG::FinalSolverState status)
virtual int init(UG::ParaParamSet *paraParams, int argc, char **argv)
void setUserPlugins(ScipUserPlugins *inUi)
double getGapValue(SCIP *inScip)
void outputProblemInfo(int *nNonLinearConsHdlrs)
void setNumberOfNodesSolved(long long n)
void includeUserPlugins(SCIP *inScip, const char *inLogname, bool inQuiet, bool inComment)
ScipParaInstance * instance
int reInit(int nRestartedRacing)
virtual ~ScipParaInitiator()
ScipParaSolution * solution
void accumulateInitialStat(UG::ParaInitialStat *initialStat)
UG::FinalSolverState finalState
UG::ParaParamSet * paraParams
ScipDiffParamSet * scipDiffParamSetRoot
bool onlyLinearConsHandler()
char * getSolutionFileName()
double convertToInternalValue(double externalValue)
double convertToExternalValue(double internalValue)
Class for the difference between instance and subproblem.
BbParaInitiator(ParaComm *inComm, ParaTimer *inTimer)
constructor
double * tightenedVarUbs
array of tightened upper bound of variable
double * tightenedVarLbs
array of tightened lower bound of variable
Base class of communicator object.
class for initial statistics collecting after racing
bool getBoolParamValue(int param)
get bool parameter value
class ParaRacingRampUpParamSet (parameter set for racing ramp-up)
ScipParaInitiator * ScipParaInitiatorPtr
FinalSolverState
Final status of computation.
Defines for UG Framework.
SCIP parameter set to be transferred ( Only keep difference between default settings ).
ParaComm extension for SCIP solver.
ParaInitialStat extension for SCIP solver.
ParaInstance extenstion for SCIP solver.
ParaSolution extension for SCIP solver.