mipstopexpr1.gms : mip stop expression test

Description

Tests the solver link option 'mipstopexpr' of solvers that support this feature.
The mip stop expression offers a high flexibility in formulating stopping
criteria for branch-and-bound.

Contributor: Renke Kuhlmann, October 2020


Small Model of Type : GAMS


Category : GAMS Test library


Main file : mipstopexpr1.gms

$title 'mip stop expression test' (MIPSTOPEXPR1,SEQ=834)
$if not '%GAMS.mip%' == '' $set solver %GAMS.mip%
$if not set solver         $set solver gurobi
$onText
Tests the solver link option 'mipstopexpr' of solvers that support this feature.
The mip stop expression offers a high flexibility in formulating stopping
criteria for branch-and-bound.

Contributor: Renke Kuhlmann, October 2020
$offText

$call gamslib -q 272

$call.checkErrorLevel gams dicex.gms lo=%GAMS.lo% solver=%solver% --nosolve=1 s=0

$onEcho > %solver%.opt
mipstopexpr "nodusd >= 1 && objval < 10000 || nodusd >= 2"
$offEcho

$onEcho > dicex_solve.gms
option resLim = 50, optCr = 0.0, optCa = 0.99, threads = 1;
solve diceU using mip maximizing wnx;
abort$(diceU.solvestat <> %solveStat.terminatedBySolver% and diceU.solvestat <> %solveStat.userInterrupt%) 'wrong solve stat';
abort$(diceU.modelstat <> %modelStat.integerSolution% and diceU.modelstat <> %modelStat.noSolutionReturned%
    and diceU.modelstat <> %modelStat.intermediateNonInteger% and diceU.modelstat <> %modelstat.IntermediateNonOptimal%) 'wrong model stat';
abort$(diceU.nodusd > 2) 'wrong number of nodes';
$offEcho

$call.checkErrorLevel gams dicex_solve.gms lo=%GAMS.lo% solver=%solver% optfile=1 r=0

$onEcho > %solver%.opt
mipstopexpr "nodusd > abc"
$offEcho

$onEcho > dicex_solve.gms
option resLim = 50, optCr = 0.0, optCa = 0.99, threads = 1;
solve diceU using mip maximizing wnx;
abort$(diceU.solvestat < %solveStat.setupFailure%) 'wrong solve stat';
$offEcho

$call.checkErrorLevel gams dicex_solve.gms lo=%GAMS.lo% solver=%solver% optfile=1 r=0