% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/set_solver.R
\name{set_solver_gurobi}
\alias{set_solver_gurobi}
\title{Configure Gurobi solver settings}
\usage{
set_solver_gurobi(
  x,
  ...,
  solver_params = list(),
  gap_limit = NULL,
  time_limit = NULL,
  solution_limit = NULL,
  cores = NULL,
  verbose = FALSE,
  log_file = NULL,
  write_log = NULL
)
}
\arguments{
\item{x}{A \code{Problem} object.}

\item{...}{Additional named solver-specific parameters. These are merged into
\code{solver_params}. For example, \code{MIPFocus = 1} for Gurobi.}

\item{solver_params}{Named list of solver-specific parameters. These are
merged with previously stored backend-specific parameters rather than
replacing them completely.}

\item{gap_limit}{Optional numeric value in \eqn{[0,1]} giving the relative
optimality gap for mixed-integer optimization. If \code{NULL}, the
previously stored value is kept unchanged.}

\item{time_limit}{Optional non-negative numeric value giving the maximum
solving time in seconds. If \code{NULL}, the previously stored value is
kept unchanged.}

\item{solution_limit}{Optional logical flag controlling backend-specific
early stopping after feasible solution discovery. If \code{NULL}, the
previously stored value is kept unchanged.}

\item{cores}{Optional positive integer giving the number of CPU cores to use.
If \code{NULL}, the previously stored value is kept unchanged.}

\item{verbose}{Optional logical flag indicating whether the solver should
print log output. If \code{NULL}, the previously stored value is kept
unchanged.}

\item{log_file}{Optional character string giving the name of the
solver log file. If \code{NULL}, the previously stored value is kept
unchanged.}

\item{write_log}{Optional logical flag indicating whether solver output
should be written to a file. If \code{NULL}, the previously stored value is
kept unchanged.}
}
\value{
An updated \code{Problem} object with Gurobi solver settings stored
in \code{x$data$solve_args}.
}
\description{
Convenience wrapper around \code{\link{set_solver}} that stores
\code{solver = "gurobi"} in the problem object.

This function does not solve the model. It only updates the stored solver
configuration.
}
\examples{
pu_tbl <- data.frame(
  id = 1:4,
  cost = c(1, 2, 3, 4)
)

feat_tbl <- data.frame(
  id = 1:2,
  name = c("feature_1", "feature_2")
)

dist_feat_tbl <- data.frame(
  pu = c(1, 1, 2, 3, 4),
  feature = c(1, 2, 2, 1, 2),
  amount = c(5, 2, 3, 4, 1)
)

x <- create_problem(
  pu = pu_tbl,
  features = feat_tbl,
  dist_features = dist_feat_tbl,
  cost = "cost"
)

x <- set_solver_gurobi(
  x,
  gap_limit = 0.01,
  time_limit = 600,
  cores = 2,
  MIPFocus = 1
)

x$data$solve_args

}
\seealso{
\code{\link{set_solver}},
\code{\link{solve}}
}
