compile: Compile a problem

Description Usage Arguments Details Value Examples

View source: R/compile.R

Description

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

Usage

1
2
3
4
compile(x, ...)

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

Arguments

x

ProjectProblem object.

...

not used.

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.

Value

OptimizationProblem object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# 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)

oppr documentation built on May 12, 2021, 1:07 a.m.