nvars: Number of variables of a model

View source: R/model-api.R

nvarsR Documentation

Number of variables of a model

Description

Number of variables of a model

Usage

nvars(model)

Arguments

model

the model

Value

a list with three named elements. 'binary' => number of binary variables, 'integer' => number of integer variables, 'continuous' => number of continuous variables.

Examples

library(magrittr)
model <- MIPModel() %>%
  add_variable(x[i], i = 1:10, type = "binary") %>%
  add_variable(y[i], i = 1:5, type = "continuous") %>%
  add_variable(z[i], i = 1:2, type = "integer")
nvars(model)

dirkschumacher/romp documentation built on Sept. 16, 2023, 4:06 p.m.