getPerformance {prioriactions}R Documentation

Extract general information about solution

Description

Provides general information about the process of solving.

Usage

getPerformance(x)

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:

Value

data.frame.

Examples


# 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)



[Package prioriactions version 0.5.0 Index]