Learn R Programming

prioriactions (version 0.5.0)

getPerformance: Extract general information about solution

Description

Provides general information about the process of solving.

Usage

getPerformance(x)

Value

data.frame.

Arguments

x

solution or portfolio object.

Details

getPerformance() function returns five specific fields:

  1. solution_name: indicates the name of the solution, by default is sol.

  2. objective_value: indicates the value of the objective function of a given solution. This value depends on the type of model solved (more information in the problem() function).

  3. gap: returns the relative MIP optimality gap of a solution. It is measured as the ratio between the objective function induced by the best known (primal solution) integer solution and the objective function induced by the best node in the search tree (dual solution).

  4. solving_time: indicates the solving time of mathematical model.

  5. status: provides the status of solver at the end of the optimization period. This can have six states:

  • Optimal solution (according to gap tolerance) : When the resolution of the model stop when the quality of the solution (gap) is less than or equal to gap_limit (parameter of the solve() function).

  • No solution (model was proven to be infeasible or unbounded): When the model is infeasible.

  • Feasible solution (according to time limit): When the resolution of the model stops when a time_limit has been reached finding a feasible solution (parameter of the solve() function).

  • No solution (according to time limit): When the resolution of the model stops when a time_limit has been reached without finding a feasible solution (parameter of the solve() function).

  • First feasible solution: When the resolution of the model stops when it has found the first feasible solution (solution_limit = TRUE parameter in solve() function).

  • No solution information is available: For any other case.

Examples

Run this code
# \donttest{
# set seed for reproducibility
set.seed(14)

## Load data
data(sim_pu_data, sim_features_data, sim_dist_features_data,
sim_threats_data, sim_dist_threats_data, sim_sensitivity_data,
sim_boundary_data)

## Create data instance
problem_data <- inputData(
  pu = sim_pu_data, features = sim_features_data, dist_features = sim_dist_features_data,
  threats = sim_threats_data, dist_threats = sim_dist_threats_data,
  sensitivity = sim_sensitivity_data, boundary = sim_boundary_data
)

## Create optimization model
problem_model <- problem(x = problem_data, blm = 1)

## Solve the optimization model
s <- solve(a = problem_model, time_limit = 2, output_file = FALSE, cores = 2)

# get solution gap
getPerformance(s)
# }

Run the code above in your browser using DataLab