Commit d05a9d61 authored by Erkka Rinne's avatar Erkka Rinne
Browse files

Allow model status 1 or 8 in case of solver error

parent 7022fa8a
......@@ -127,6 +127,12 @@ $include '%input_dir%/modelsInit.gms'
* === Simulation ==============================================================
// Macro for checking solve status (1 = normal completion)
$macro checkSolveStatus(mdl) \
if(mdl.solveStat > 1 and (mdl.modelStat <> 1 or mdl.modelStat <> 8), \
execError = execError + 1 \
)
$include 'inc/3a_periodicInit.gms' // Initialize modelling loop
loop(modelSolves(mSolve, tSolve)$(execError = 0),
solveCount = solveCount + 1;
......
# Changelog
All notable changes to this project will be documented in this file.
## Unreleased
### Added
## 1.1.6
### Changed
- Raise execution error if solver did not finish normally
## 1.1.5
......
......@@ -51,22 +51,21 @@ $offtext
schedule.holdfixed = 1; // Enable holdfixed, which makes the GAMS compiler convert fixed variables into parameters for the solver.
schedule.OptFile = 1;
solve schedule using mip minimizing v_obj;
// Check solve status (1 = normal completion)
if(schedule.solveStat > 1, execError = execError + 1);
checkSolveStatus(schedule);
); // END IF SCHEDULE
if (mSolve('building'),
building.holdfixed = 1;
building.OptFile = 1;
solve building using mip minimizing v_obj;
if(building.solveStat > 1, execError = execError + 1);
checkSolveStatus(building);
); // END IF BUILDING
if (mSolve('invest'),
invest.holdfixed = 1; // Enable holdfixed, which makes the GAMS compiler convert fixed variables into parameters for the solver.
invest.OptFile = 1;
solve invest using mip minimizing v_obj;
if(invest.solveStat > 1, execError = execError + 1);
checkSolveStatus(invest);
); // END IF INVEST
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment