Create a new binding constraint in an Antares study.
createBindingConstraintBulk()
allow to create multiple constraints at once.
createBindingConstraint(
name,
id = tolower(name),
values = NULL,
enabled = TRUE,
timeStep = c("hourly", "daily", "weekly"),
operator = c("both", "equal", "greater", "less"),
filter_year_by_year = "hourly, daily, weekly, monthly, annual",
filter_synthesis = "hourly, daily, weekly, monthly, annual",
coefficients = NULL,
overwrite = FALSE,
opts = antaresRead::simOptions()
)
createBindingConstraintBulk(constraints, opts = antaresRead::simOptions())
The name for the binding constraint.
An id, default is to use the name.
Values used by the constraint. It contains one line per time step and three columns "less", "greater" and "equal".
Logical, is the constraint enabled ?
Time step the constraint applies to : hourly
, daily
or weekly
.
Type of constraint: equality, inequality on one side or both sides.
Marginal price granularity for year by year
Marginal price granularity for synthesis
A named vector containing the coefficients used by the constraint, the coefficients have to be alphabetically ordered.
If the constraint already exist, overwrite the previous value.
List of simulation parameters returned by the function
antaresRead::setSimulationPath()
A list
of several named list
containing data to create binding constraints.
Warning all arguments for creating a binding constraints must be provided, see examples.
An updated list containing various information about the simulation.
editBindingConstraint()
to edit existing binding constraints, removeBindingConstraint()
to remove binding constraints.
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)
}