objective_function | R Documentation |
Extract the objective function from a model
objective_function(model)
model |
the model |
a list with two named elements, 'solution' and 'constant'. 'solution' is a sparse vector from the Matrix package. 'constant' is a constant that needs to be added to get the final obj. value.
library(magrittr)
model <- MIPModel() %>%
add_variable(x[i], i = 1:5) %>%
set_objective(sum_over(i * x[i], i = 1:5) + 10)
objective_function(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.