Convenience wrapper around set_solver that stores
solver = "symphony" in the problem object.
This function does not solve the model. It only updates the stored solver configuration.
Usage
set_solver_symphony(
x,
...,
solver_params = list(),
gap_limit = NULL,
time_limit = NULL,
solution_limit = NULL,
cores = NULL,
verbose = NULL,
log_file = NULL,
write_log = NULL
)Arguments
- x
A
Problemobject.- ...
Additional named solver-specific parameters. These are merged into
solver_params. For example,MIPFocus = 1for Gurobi.- 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 \([0,1]\) giving the relative optimality gap for mixed-integer optimization. If
NULL, the previously stored value is kept unchanged.- time_limit
Optional non-negative numeric value giving the maximum solving time in seconds. If
NULL, the previously stored value is kept unchanged.- 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
NULL, the previously stored value is kept unchanged.- cores
Optional positive integer giving the maximum number of solver threads. Currently supported by Gurobi. If
NULL, the previously stored value is kept unchanged.- verbose
Optional logical flag indicating whether the solver should print log output. If
NULL, the previously stored value is kept unchanged.- log_file
Optional character string giving the complete path or file name of the solver log. Currently supported by Gurobi. If
NULL, the previously stored value is kept unchanged.- write_log
Optional logical flag indicating whether solver output should be written to a file. Currently supported by Gurobi. If
NULL, the previously stored value is kept unchanged.
Examples
# 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_symphony(
x,
gap_limit = 0.05,
time_limit = 300
)
x$data$solve_args
#> $solver
#> [1] "symphony"
#>
#> $gap_limit
#> [1] 0.05
#>
#> $time_limit
#> [1] 300
#>
#> $solver_params
#> list()
#>
#> $output_file
#> [1] FALSE
#>
