create-binding-constraint | R Documentation |
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())
name |
The name for the binding constraint. |
id |
An id, default is to use the name. |
values |
Values used by the constraint. It contains one line per time step and three columns "less", "greater" and "equal". |
enabled |
Logical, is the constraint enabled ? |
timeStep |
Time step the constraint applies to : |
operator |
Type of constraint: equality, inequality on one side or both sides. |
filter_year_by_year |
Marginal price granularity for year by year |
filter_synthesis |
Marginal price granularity for synthesis |
coefficients |
A named vector containing the coefficients used by the constraint. |
overwrite |
If the constraint already exist, overwrite the previous value. |
opts |
List of simulation parameters returned by the function
|
constraints |
A |
An updated list containing various information about the simulation.
editBindingConstraint()
to edit existing binding constraints, removeBindingConstraint()
to remove binding constraints.
## Not run:
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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.