Learn R Programming

oppr (version 1.0.0)

compile: Compile a problem

Description

Compile a project prioritization problem into a general purpose format for optimization.

Usage

compile(x, ...)

# S3 method for ProjectProblem compile(x, ...)

Arguments

...

not used.

Value

OptimizationProblem-class object.

Details

This function might be useful for those interested in understanding how their project prioritization problem is expressed as a mathematical problem. However, if the problem just needs to be solved, then the solve function should be used instead.

Examples

Run this code
# NOT RUN {
# load data
data(sim_projects, sim_features, sim_actions)

# build problem with maximum richness objective, $200 budget, and
# binary decisions
p <- problem(sim_projects, sim_actions, sim_features,
             "name", "success", "name", "cost", "name") %>%
     add_max_richness_objective(budget = 200) %>%
     add_binary_decisions()

# print problem
print(p)

# compile problem
o <- compile(p)

# print compiled problem
print(o)
# }

Run the code above in your browser using DataLab