Bellow is an objective function code, that is meant to evaluate discomfort hours, by extracting data from the table displayed above.
# Evaluate discomfort hours
discomfort_hours <- function(idf) {
# Local definition of time (hours) not meeting adaptive comfort model
discomfort_time <- as.double(idf$last_job()$tabular_data(
report_name = "AdaptiveComfortSummary",
table_name = "Time Not Meeting the Adaptive Comfort Models during Occupied Hours",
row_name = "OCCUPANTS",
column_name = "ASHRAE55 80% Acceptability Limits"
)
$value)
# Evaluate the discomfort hours
discomfort_time<-(discomfort_time/8760)*100
# return discomfort hours
discomfort_time
}
However, I encountered the following error when I tried to run the code. Please, can you help me resolve the problem, sir?
-- Initialization --------------------------------------------------------------------------------------
* Create initial population
Checking if parameter(s) has been set ...
Checking if objective(s) has been set ...
Validating parameter function 'design_options' ...
Validating objective function(s)...
[1] 'combined_primary_energy' --> OK
[2] 'combined_global_cost' --> OK
Error: Objective function 'discomfort_hours' should return at least a length-one vector instead of a 0-length one.
@hongyuanjia, greetings of the day.
Bellow is an objective function code, that is meant to evaluate discomfort hours, by extracting data from the table displayed above.
However, I encountered the following error when I tried to run the code. Please, can you help me resolve the problem, sir?