inspect_mip | R Documentation |
Utility function to inspect the mip problem for a record. inspect_mip
can
be used as a "drop-in" replacement for locate_errors()
, but works on the
first record.
inspect_mip(data, x, weight, ...)
data |
data to be checked |
x |
validation rules or errorlocalizer object to be used for finding possible errors. |
weight |
|
... |
optional parameters that are passed to |
It may sometimes be handy to find out what is happening exactly with a record.
See the example section for finding out what to do with inspect_mip. See
vignette("inspect_mip")
for more details.
Other Mixed Integer Problem:
MipRules-class
rules <- validator(x > 1)
data <- list(x = 0)
weight <- c(x = 1)
mip <- inspect_mip(data, rules)
print(mip)
# inspect the lp problem (prior to solving it with lpsolveAPI)
lp <- mip$to_lp()
print(lp)
# for large problems write the lp problem to disk for inspection
# lpSolveAPI::write.lp(lp, "my_problem.lp")
# solve the mip system / find a solution
res <- mip$execute()
names(res)
# lpSolveAPI status of finding a solution
res$s
# lp problem after solving (often simplified version of first lp)
res$lp
# records that are deemed "faulty"
res$errors
# values of variables used in the mip formulation. Also contains a valid solution
# for "faulty" variables
res$values
# see the derived mip rules and objective function, used in the construction of
# lp problem
mip$mip_rules()
mip$objective
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.