set_bounds: Set the bounds of a variable

Description Usage Arguments Examples

View source: R/class-model.R

Description

Change the lower and upper bounds of a named variable, indexed variable or a group of variables.

Usage

1
2
3
set_bounds(.model, .variable, ..., lb = NULL, ub = NULL)

set_bounds_(.model, .variable, ..., lb = NULL, ub = NULL, .dots)

Arguments

.model

the model

.variable

the variable name/definition

...

quantifiers for the indexed variable

lb

the lower bound of the variable

ub

the upper bound of the variable

.dots

Used to work around non-standard evaluation.

Examples

1
2
3
4
5
library(magrittr)
MIPModel() %>%
 add_variable(x[i], i = 1:5) %>%
 add_constraint(x[i] >= 1, i = 1:5) %>% # creates 5 constraints
 set_bounds(x[i], lb = 3, i = 1:3)

dirkschumacher/romp documentation built on Oct. 6, 2018, 4:36 a.m.