Documentation
¶
Index ¶
- func ExtractValueOfVariable(s Solution, v symbolic.Variable) (float64, error)
- func ExtractValueOfVariableWithID(s Solution, idx uint64) (float64, error)
- func FindValueOfExpression(s Solution, expr symbolic.Expression) (symbolic.Expression, error)
- func GetOptimalObjectiveValue(sol Solution) (float64, error)
- type DummySolution
- type Solution
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractValueOfVariable ¶
func FindValueOfExpression ¶
func FindValueOfExpression(s Solution, expr symbolic.Expression) (symbolic.Expression, error)
FindValueOfExpression evaluates a symbolic expression using the values from a solution. It substitutes all variables in the expression with their values from the solution and returns the resulting symbolic expression (typically a constant).
func GetOptimalObjectiveValue ¶ added in v0.6.4
GetOptimalObjectiveValue evaluates the objective function of an optimization problem at the solution point. It uses the FindValueOfExpression function to compute the value of the objective expression using the variable values from the solution.
Types ¶
type DummySolution ¶
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 }
func (*DummySolution) GetOptimalValue ¶
func (ds *DummySolution) GetOptimalValue() float64
func (*DummySolution) GetProblem ¶ added in v0.6.4
func (ds *DummySolution) GetProblem() *problem.OptimizationProblem
func (*DummySolution) GetStatus ¶
func (ds *DummySolution) GetStatus() solution_status.SolutionStatus
func (*DummySolution) GetValueMap ¶
func (ds *DummySolution) GetValueMap() map[uint64]float64
type Solution ¶
type Solution interface { GetOptimalValue() float64 GetValueMap() map[uint64]float64 // GetStatus // GetStatus() solution_status.SolutionStatus // GetProblem returns the optimization problem that this solution is for GetProblem() *problem.OptimizationProblem }
Solution stores the solution of an optimization problem and associated metadata
Click to show internal directories.
Click to hide internal directories.