getPerformance {prioriactions} | R Documentation |
Extract general information about solution
Description
Provides general information about the process of solving.
Usage
getPerformance(x)
Arguments
x |
Details
getPerformance()
function returns five specific fields:
-
solution_name: indicates the name of the solution, by default is sol.
-
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). -
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).
-
solving_time: indicates the solving time of mathematical model.
-
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.
Value
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)