Parameter changes are specified using a list variable having multiple named components, which is passed as an argument to the appropriate Gurobi function (e.g., gurobi). The name of each named component must be the name of a Gurobi parameter, and the associated value should be the desired value of that parameter. You can find a complete list of the available Gurobi parameters in the reference manual.
To create a list that would set the Gurobi
Method parameter to 2 and the
ResultFile parameter to
model.mps, you would do the following:
params <- list()
params$Method <- 2
params$ResultFile <- 'model.mps'
We should say a bit more about the ResultFile parameter. If this parameter is set, the optimization model that is eventually passed to Gurobi will also be output to the specified file. The filename suffix should be one of .mps, .lp, .rew, .rlp, .dua, or.dlp, to indicate the desired file format (see the file format section in the reference manual for details on Gurobi file formats).
The params struct can also be used to set license specific parameters, that define the computational environment to be used. We will discuss the two most common use cases next, and refer again to the collection of all available parameters in the reference manual.
Using a Compute Server License
Gurobi Compute Server allows you to offload optimization jobs to a remote server. Servers are organized into clusters. By providing the name of any node within the cluster, your job will automatically be sent to the least heavily loaded node in the cluster. If all nodes are at capacity, your job will be placed in a queue, and will proceed once capacity becomes available. You can find additional information about Gurobi Compute Server in the Gurobi Remote Services Reference Manual. The most commonly used parameters are the following.
Here is an example of how to use a params argument to connect
to a Compute Server:
params <- list()
params$ComputeServer <- 'server1.mycompany.com:61000'
params$CSPriority <- 5
Using a Gurobi Instant Cloud License
Gurobi Instant Cloud allows you to offload optimization jobs to a Gurobi Compute Server on the cloud. If an appropriate machine is already running, the job will run on that machine. It will automatically launch a new machine otherwise. Note that launching a new machine can take a few minutes. You can find additional information about the Gurobi Instant Cloud service in the reference manual. The most commonly used parameters are the following.
Here is an example of how to use a params argument to launch a
Gurobi Instant Cloud instance:
params <- list()
params$CloudAccessID <- '3d1ecef9-dfad-eff4-b3fa'
params$CloudSecretKey <- 'ae6L23alJe3+fas'