Commit aae885b
Runner: run_solver.py update with knitro (#410)
The goal of this pull request is add support for the `knitro` solver in
the `run_solver.py` script.
The interface between `linopy` and the `knitro` Python API is introduced
in this [pull request.](PyPSA/linopy#532)
## Changes
### `run_solver.py`
I have added a `knitro` specification for the following functions:
- `def get_solver`
- `def def is_mip_problem`
- `def get_reported_runtime`
- `def get_duality_gap`
## Test
I tested the integration between knitro and linopy and the changes to
run_solver.py on the benchmark
[pypsa-eur-elec-trex-3-12h.lp](https://storage.googleapis.com/solver-benchmarks/pypsa-eur-elec-trex-3-12h.lp).
I get:
`{"runtime": 4.476548100999992, "reported_runtime": 3.8160810470581055,
"status": "ok", "condition": "optimal", "objective": 7398198432.386027,
"duality_gap": null, "max_integrality_violation": null}`
The value of the objective function is compatible to those found
[here](https://openenergybenchmark.org/dashboard/benchmark-set/pypsa-eur-elec-trex)
---------
Co-authored-by: Daniele Lerede <daniele.lerede@openenergytransition.org>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>1 parent 5492470 commit aae885b
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
| |||
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
106 | 112 | | |
107 | 113 | | |
108 | 114 | | |
| |||
135 | 141 | | |
136 | 142 | | |
137 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
138 | 147 | | |
139 | 148 | | |
140 | 149 | | |
| |||
180 | 189 | | |
181 | 190 | | |
182 | 191 | | |
| 192 | + | |
| 193 | + | |
183 | 194 | | |
184 | 195 | | |
185 | 196 | | |
| |||
0 commit comments