# NOT RUN {
# load data
data(sim_projects, sim_features, sim_actions)
# create data frame with targets
targets <- data.frame(feature = sim_features$name,
type = "absolute",
target = 0.1)
# print targets
print(targets)
# build problem with minimum set objective and targets that require each
# feature to have a 30% chance of persisting into the future
p <- problem(sim_projects, sim_actions, sim_features,
"name", "success", "name", "cost", "name") %>%
add_min_set_objective() %>%
add_manual_targets(targets) %>%
add_binary_decisions()
# print problem
print(p)
# }
# NOT RUN {
# solve problem
s <- solve(p)
# print solution
print(s)
# }
Run the code above in your browser using DataLab