scipopt / JSCIPOpt

Java interface for the SCIP Optimization Suite
MIT License
62 stars 35 forks source link

adds: SCIP::getStage #45

Closed fuookami closed 6 months ago

fuookami commented 6 months ago

I'm developing a modeling DSL. Because I am not sure if the SCIP in the user's system environment supports concurrent solving mode, if I want to use SCIP::solveConcurrent(), I may encounter the message "SCIP was compiled without task processing interface. Parallel solve not possible", for example: https://github.com/scipopt/PySCIPOpt/issues/705. Therefore, I need to know the status of SCIP after calling SCIP::solveConcurrent() to determine if I need to call SCIP::solve() to ensure the solving process, like here:

scip.solveConcurrent()
// if not supports concurrent solving mode, it will print "... Parallel solve not possible" and do nothing
val stage = scip.getStage()
if (stage.swigValue() < SCIP_Stage.SCIP_STAGE_INITPRESOLVE.swigValue()) {
    scip.solve()
}
kkofler commented 6 months ago

Looks good, merging.