| set_solver_gurobi | R Documentation |
Convenience wrapper around set_solver that stores
solver = "gurobi" in the problem object.
This function does not solve the model. It only updates the stored solver configuration. A solver can be configured only once per problem. Calling this wrapper after any solver setter raises an error. Derive alternatives from the same problem before its first solver configuration.
set_solver_gurobi(
x,
...,
solver_params = list(),
gap_limit = NULL,
time_limit = NULL,
solution_limit = NULL,
cores = NULL,
verbose = NULL,
log_file = NULL,
write_log = NULL
)
x |
A |
... |
Additional named solver-specific parameters. These are merged into
|
solver_params |
Named list of solver-specific parameters. These are merged with previously stored parameters. Rcplex parameters are validated against its supported control names; Rsymphony does not currently receive arbitrary solver-specific parameters. |
gap_limit |
Optional numeric value in |
time_limit |
Optional non-negative numeric value giving the maximum
solving time in seconds. If |
solution_limit |
Optional logical flag requesting early termination
after a feasible solution is found. Supported by Gurobi, CBC, and
SYMPHONY, but not by CPLEX through Rcplex. If |
cores |
Optional positive integer giving the maximum number of solver
threads. Currently supported by Gurobi. If |
verbose |
Optional logical flag indicating whether the solver should
print log output. If |
log_file |
Optional character string giving the complete path or file
name of the solver log. Currently supported by Gurobi. If |
write_log |
Optional logical flag indicating whether solver output
should be written to a file. Currently supported by Gurobi. If
|
An updated Problem object with Gurobi solver settings stored
in x$data$solve_args.
set_solver,
solve
# Load a complete simulated planning problem.
example_data <- load_sim_multiaction()
x <- create_problem(
pu = example_data$planning_units,
features = example_data$features,
dist_features = example_data$dist_features,
cost = "cost"
)
x <- set_solver_gurobi(
x,
gap_limit = 0.01,
time_limit = 600,
cores = 2,
MIPFocus = 1
)
x$data$solve_args
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.