if (FALSE) {
createBindingConstraint(
name = "myconstraint",
values = matrix(data = rep(0, 8760 * 3), ncol = 3),
enabled = FALSE,
timeStep = "hourly",
operator = "both",
coefficients = c("fr%myarea" = 1)
)
# Create multiple constraints
# Prepare data for constraints
bindings_constraints <- lapply(
X = seq_len(100),
FUN = function(i) {
# use arguments of createBindingConstraint()
# all arguments must be provided !
list(
name = paste0("constraints", i),
id = paste0("constraints", i),
values = matrix(data = rep(0, 8760 * 3), ncol = 3),
enabled = FALSE,
timeStep = "hourly",
operator = "both",
coefficients = c("area1%area2" = 1),
overwrite = TRUE
)
}
)
# create all constraints
createBindingConstraintBulk(bindings_constraints)
}
Run the code above in your browser using DataLab