I'm trying to run a parametric analysis in EnergyPlus (idf file) through R, by using the eplusr and epluspar packages. But when I set my optimization variables (from EnergyPlus objects) I'm getting an error in match.call that I don't know where is it. Could anyone help me please? My code is:
dir <- eplus_config(9.6)$dir
path_model <- file.path(dir, "RWTH/SchoolA-calibrated_MO-R01.idf")
path_weather <- file.path(dir, "RWTH/BRA_SP_Campinas-Viracopos.Intl.AP.837210_TMYx.2007-2021.epw")
# read model
idf <- read_idf(path_model)
# define a measure to change the window status
set_window_status <- function (idf, wst) {
wst <- as.character(wst)
idf$set(wst_scenario = list(program_name_1 = wst))
idf
}
# define a measure to change occupancy
set_occupancy <- function (idf, occ) {
occ <- as.character(occ)
idf$set(ocupacao_z1 = list(number_of_people = occ))
}
# combine all measures into one
design_options <- function (idf, window_status, occupancy) {
idf <- set_window_status(idf, window_status)
idf <- set_occupancy(idf, occupancy)
idf
}
# specify design space of parameters
ga$apply_measure(design_options,
window_status = choice_space(as.character(seq(1, 12, 1))),
occupancy = choice_space(as.character(seq(6, 31, 5))),
)
The error appears after I run the "specify design space of parameters" part and it is:
Error in match.call(definition, call, expand.dots, envir) :
unused argument (..3)
The following names are provided from the EnergyPlus idf file:
- wst_scenario: name of the object
- program_name_1: name of the line I want the parametric variation to occur
- ocupacao_z1: name of the object
- number_of_people: name of the line I want the parametric variation to occur
I tried to change their names (including/ excluding capital letters, including excluding the "_" in between words) but it didn't work.
Here is the path to the idf and weather files: https://drive.google.com/drive/folders/1bX8ZB2aUXMRrEUqlpMMM6K8avs6LyIdK?usp=share_link