solve: Solve RAP object

solveR Documentation

Solve RAP object

Description

This function uses Gurobi to find prioritizations using the input parameter and data stored in a RapUnsolved() object, and returns a RapSolved() object with outputs in it.

Usage

## S4 method for signature 'RapUnsolOrSol,missing'
solve(a, b, ..., verbose = FALSE)

## S4 method for signature 'RapUnsolOrSol,GurobiOpts'
solve(a, b, verbose = FALSE)

## S4 method for signature 'RapUnsolOrSol,matrix'
solve(a, b, verbose = FALSE)

## S4 method for signature 'RapUnsolOrSol,numeric'
solve(a, b, verbose = FALSE)

## S4 method for signature 'RapUnsolOrSol,logical'
solve(a, b, verbose = FALSE)

Arguments

a

RapUnsolved() or RapSolved() object.

b

missing to generate solutions using Gurobi. Prioritizations can be specified using logical, numeric, or base::matrix() objects. This may be useful for evaluating the performance of solutions obtained using other software.

...

not used.

verbose

logical should messages be printed during creation of the initial model matrix?.

Value

RapSolved() object

Note

This function is used to solve a RapUnsolved() object that has all of its inputs generated. The rap function (without lower case 'r') provides a more general interface for generating inputs and outputs.

See Also

RapUnsolved(), RapSolved().

Examples

## Not run: 
# load RapUnsolved object
data(sim_ru)
# solve it using Gurobi
sim_rs <- solve(sim_ru)

# evaluate manually specified solution using planning unit indices
sim_rs2 <- solve(sim_ru, seq_len(10))

# evaluate manually specifed solution using binary selections
sim_rs3 <- solve(sim_ru, c(rep(TRUE, 10), rep(FALSE, 90)))

#  evaluate multiple manually specified solutions
sim_rs4 <- solve(sim_ru, matrix(sample(c(0, 1), size = 500, replace = TRUE),
                 ncol = 100, nrow = 5))

## End(Not run)

paleo13/rapr documentation built on Feb. 12, 2024, 3:27 a.m.