Skip to contents

This class is used to represent solvers for optimization. Only experts should use the fields and methods for this class directly.

Super class

ConservationModifier -> Solver

Methods

Inherited methods


Solver$run()

Run the solver to generate a solution.

Usage

Solver$run()

Returns

list of solutions.


Solver$calculate()

Perform computations that need to be completed before applying the object.

Usage

Solver$calculate(...)

Arguments

...

Additional arguments.

x

optimization_problem() object.

Returns

Invisible TRUE.


Solver$set_variable_ub()

Set the upper bound for a decision variable.

Usage

Solver$set_variable_ub(index, value)

Arguments

index

integer value indicating the index of the decision variable.

value

numeric new bound value.

Details

Note that this method should only be run after $calculate(). It can be used to overwrite values after ingesting an optimization_problem() object. It is designed to be used in portfolios and importance functions.

Returns

Invisible TRUE.


Solver$set_variable_lb()

Set the lower bound for a decision variable.

Usage

Solver$set_variable_lb(index, value)

Arguments

index

integer value indicating the index of the decision variable.

value

numeric new bound value.

Details

Note that this method should only be run after $calculate(). It can be used to overwrite values after ingesting an optimization_problem() object. It is designed to be used in portfolios and importance functions.

Returns

Invisible TRUE.


Solver$set_constraint_rhs()

Set the right-hand-side coefficient bound for a constraint.

Usage

Solver$set_constraint_rhs(index, value)

Arguments

index

integer value indicating the index of the decision variable.

value

numeric new value.

Details

Note that this method should only be run after $calculate(). It can be used to overwrite values after ingesting an optimization_problem() object. It is designed to be used in portfolios and importance functions.

Returns

Invisible TRUE.


Solver$set_start_solution()

Set the starting solution.

Usage

Solver$set_start_solution(value, warn = TRUE)

Arguments

value

numeric vector.

warn

logical indicating if a warning should be displayed if the solver does not support starting solutions.

Details

This method is designed used in portfolios and importance functions.

Returns

Invisible TRUE.


Solver$remove_start_solution()

Remove the starting solution.

Usage

Solver$remove_start_solution()

Details

This method is designed used in portfolios and importance functions.

Returns

Invisible TRUE.


Solver$solve()

Solve an optimization problem.

Usage

Solver$solve(x, ...)

Arguments

x

optimization_problem() object.

...

Additional arguments passed to the calculate() method.

Returns

A list object with the solution and additional information.


Solver$default_solve_multiobj()

Solve a multi-objective optimization problem using a hierarchical multi-objective optimization approach. Broadly speaking, this approach involves using multiple optimization procedures to solve objectives following a hierarchical (lexicographic) ordering, wherein those associated with a higher priority order are solved before those with a lower priority order. When implementing this approach, constraints are added after generating a given solution to ensure that subsequent solutions for lower priority objectives have adequate performance according to higher priority objectives.

Usage

Solver$default_solve_multiobj(x, priority, rel_tol, ...)

Arguments

x

list object with multi-objective optimization problem. Arguments must contain the following elements: ("opt") OptimizationProblem object; ("modelsense") character vector containing the model sense values for each objective; and ("obj") numeric` matrix containing the coefficients for each of the objectives, wherein rows correspond to different objectives, columns to different decision variables and row names can be optionally specify names for the objectives.

priority

numeric vector with values indicating the priority for each objective. Greater values denote greater priority, and so objectives associated with greater values are optimized earlier in the multi-objective process.

rel_tol

numeric vector with relative tolerance values for each constraint. Greater values denote a greater degree of sub-optimality.

...

Additional arguments passed to the calculate() method.

Returns

A list object with the solution and additional information.


Solver$solve_multiobj()

Solve a multi-objective optimization problem using a hierarchical multi-objective optimization approach. Broadly speaking, this approach involves using multiple optimization procedures to solve objectives following a hierarchical (lexicographic) ordering, wherein those associated with a higher priority order are solved before those with a lower priority order. When implementing this approach, constraints are added after generating a given solution to ensure that subsequent solutions for lower priority objectives have adequate performance according to higher priority objectives.

Usage

Solver$solve_multiobj(x, priority, rel_tol, ...)

Arguments

x

list object with multi-objective optimization problem. Arguments must contain the following elements: ("opt") OptimizationProblem object; ("modelsense") character vector containing the model sense values for each objective; and ("obj") numeric` matrix containing the coefficients for each of the objectives, wherein rows correspond to different objectives, columns to different decision variables and row names can be optionally specify names for the objectives.

priority

numeric vector with values indicating the priority for each objective. Greater values denote greater priority, and so objectives associated with greater values are optimized earlier in the multi-objective process.

rel_tol

numeric vector with relative tolerance values for each constraint. Greater values denote a greater degree of sub-optimality.

...

Additional arguments passed to the calculate() method.

Returns

A list object with the solution and additional information.


Solver$clone()

The objects of this class are cloneable with this method.

Usage

Solver$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.