Commit 7022fa8a authored by Erkka Rinne's avatar Erkka Rinne
Browse files

Raise execution error if solver did not finish normally

After normal completition solve status is one. Higher values indicate an error.
parent 305ce178
# Changelog
All notable changes to this project will be documented in this file.
## Unreleased
### Added
- Raise execution error if solver did not finish normally
## 1.1.5
### Fixed
- Long-term scenario data when using only one scenario
......
......@@ -51,18 +51,22 @@ $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);
); // 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);
); // 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);
); // END IF INVEST
......
Supports Markdown
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