Solver-class: Solver class

Solver-classR Documentation

Solver class

Description

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

Super class

prioritizr::ConservationModifier -> Solver

Methods

Public methods

Inherited methods

Method run()

Run the solver to generate a solution.

Usage
Solver$run()
Returns

list of solutions.


Method 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.


Method 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.

Returns

Invisible TRUE.


Method 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.

Returns

Invisible TRUE.


Method solve()

Solve an optimization problem.

Usage
Solver$solve(x, ...)
Arguments
x

optimization_problem() object.

...

Additional arguments passed to the calculate() method.

Returns

Invisible TRUE.


Method clone()

The objects of this class are cloneable with this method.

Usage
Solver$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

Other classes: ConservationModifier-class, ConservationProblem-class, Constraint-class, Decision-class, Objective-class, OptimizationProblem-class, Penalty-class, Portfolio-class, Target-class


prioritizr documentation built on Aug. 9, 2023, 1:06 a.m.