-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdummy_solution.go
More file actions
40 lines (30 loc) · 1 KB
/
dummy_solution.go
File metadata and controls
40 lines (30 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package solution
import (
"github.com/MatProGo-dev/MatProInterface.go/problem"
solution_status "github.com/MatProGo-dev/MatProInterface.go/solution/status"
)
type DummySolution struct {
Values map[uint64]float64
// The objective for the solution
Objective float64
// Whether or not the solution is within the optimality threshold
Status solution_status.SolutionStatus
// The optimization problem that this solution is for
Problem *problem.OptimizationProblem
// The optimality gap returned from the solver. For many solvers, this is
// the gap between the best possible solution with integer relaxation and
// the best integer solution found so far.
// Gap float64
}
func (ds *DummySolution) GetOptimalValue() float64 {
return ds.Objective
}
func (ds *DummySolution) GetValueMap() map[uint64]float64 {
return ds.Values
}
func (ds *DummySolution) GetStatus() solution_status.SolutionStatus {
return ds.Status
}
func (ds *DummySolution) GetProblem() *problem.OptimizationProblem {
return ds.Problem
}