| Solver-class {prioritizr} | R 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
prioritizr::ConservationModifier$get_data()prioritizr::ConservationModifier$get_internal()prioritizr::ConservationModifier$print()prioritizr::ConservationModifier$repr()prioritizr::ConservationModifier$set_data()prioritizr::ConservationModifier$set_internal()prioritizr::ConservationModifier$show()
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.
xoptimization_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
indexintegervalue indicating the index of the decision variable.valuenumericnew 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
indexintegervalue indicating the index of the decision variable.valuenumericnew bound value.
Returns
Invisible TRUE.
Method solve()
Solve an optimization problem.
Usage
Solver$solve(x, ...)
Arguments
xoptimization_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
deepWhether 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