SIANXKE-473: implement solver that directly uses the Gurobi API#13
SIANXKE-473: implement solver that directly uses the Gurobi API#13MLackenbucher wants to merge 1 commit intoanexia:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13 +/- ##
===========================================
- Coverage 76.69% 66.20% -10.49%
===========================================
Files 45 46 +1
Lines 811 944 +133
Branches 92 115 +23
===========================================
+ Hits 622 625 +3
- Misses 144 274 +130
Partials 45 45 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
CHANGELOG.md
Outdated
| - Added possibility to use Gurobi Solver directly via the API, not using Google OR-Tools. | ||
|
|
||
| ### Changed | ||
| - Usage of AdditionalSolverParmateters. Changed list of string to list ob key-value pairs. |
There was a problem hiding this comment.
| - Usage of AdditionalSolverParmateters. Changed list of string to list ob key-value pairs. | |
| - Usage of AdditionalSolverParmateters. Changed list of string to list of key-value pairs. |
README.md
Outdated
| - Key mapping shortcuts are applied for NumberOfThreads and RelativeGap; AdditionalSolverSpecificParameters are forwarded as-is. | ||
| - TimeLimitInMilliseconds is mapped to the solver’s native time limit. |
There was a problem hiding this comment.
| - Key mapping shortcuts are applied for NumberOfThreads and RelativeGap; AdditionalSolverSpecificParameters are forwarded as-is. | |
| - TimeLimitInMilliseconds is mapped to the solver’s native time limit. | |
| - The AdditionalSolverSpecificParameters are forwarded as-is. | |
| - NumberOfThreads, TimeLimitInMilliseconds, and RelativeGap is mapped to the solver’s native time limit. |
| : MemberwiseEquatable<IlpSolver>, | ||
| IOptimizationSolver<IIntegerVariable<IRealScalar>, IRealScalar, IRealScalar, RealScalar> | ||
| { | ||
| private ILogger<IlpSolver>? Logger { get; } = logger; |
There was a problem hiding this comment.
we don't need an extra property we can use the primary constructor parameter directly.
| env.Start(); | ||
| var gurobiModel = new GRBModel(env); | ||
|
|
||
|
|
| gurobiModel.AddVar(item.Interval.LowerBound.Value, item.Interval.UpperBound.Value, 0, GRB.INTEGER, | ||
| item.Name)); | ||
|
|
||
| var cnt = 1; |
There was a problem hiding this comment.
use descriptive variable name
|
|
||
| gurobiModel.Optimize(); | ||
|
|
||
|
|
| catch (Exception e) | ||
| { | ||
| Logger?.LogError(e, "An error occurred during solving the model: {EMessage}", e.Message); | ||
| throw; | ||
| } |
There was a problem hiding this comment.
remove try catch to fix warning
|
|
||
| namespace Anexia.MathematicalProgram.Tests.Solve; | ||
|
|
||
| public sealed class GurobiSolverTest |
There was a problem hiding this comment.
| public sealed class GurobiSolverTest | |
| public sealed class GurobiNativeSolverTest |
4c2f431 to
a9068ae
Compare
No description provided.