oreni.core
oreni.core
oreni.core
config
Dict
Bases: dict
dot.notation access to dictionary attributes
engine
Engine
Bases: Core
Base class for simulation engines.
This class provides the core functionality for managing and executing simulations. It inherits from Core and implements essential attributes and methods for handling simulation cases, variables, sensors, and data.
| ATTRIBUTE | DESCRIPTION |
|---|---|
_engine_directory |
Directory path for engine operations
TYPE:
|
_output_data_path |
Directory path for output data
TYPE:
|
_cases |
List of simulation cases
TYPE:
|
_variables |
List of simulation variables
TYPE:
|
_sensors |
Dictionary of sensors
TYPE:
|
_data |
Pandas DataFrame for simulation data
TYPE:
|
variables
property
writable
This is the Vars attribute - each subclass of Foo gets its own. Lookups should follow the method resolution order.
sensors
property
writable
This is the Sensors attribute - each subclass of Foo gets its own. Lookups should follow the method resolution order.
oreni.refurbishment
oreni.refurbishment
oreni.refurbishment
catalog
Catalog
Get the template for the general and specific (category dependant) descriptions of the products, Get the allowed products categories
instantiate_catalog
Make a catalog embryo named "catname", containing several classes of products given by self.pdt_categories
| PARAMETER | DESCRIPTION |
|---|---|
cat_name
|
str, the name of the catalog
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
None
|
Updated class with new attribute "cat_name" |
update_product
According to the location (key_lv1 or key_lv2) of the parameter to be updated, the function modify its value "val"
| PARAMETER | DESCRIPTION |
|---|---|
cat_name
|
str, the name of the target catalog
TYPE:
|
pdt_name
|
str, the name of the target products to be updated
TYPE:
|
pdt_category
|
str, the class/category of the products to be updated
TYPE:
|
val
|
the value to be writen
TYPE:
|
key_lv1
|
the level 1 - of the dict tree structure - location f the parameter to be updated
TYPE:
|
key_lv2
|
the level 2 - of the dict tree structure - location f the parameter to be updated
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
None
|
Updated attribute cat_name |
add_product
Add a given products defined by "pdt" into the catalog "cat_name".
| PARAMETER | DESCRIPTION |
|---|---|
cat_name
|
str, the name of the target catalog
TYPE:
|
pdt_name
|
str, the name of the target products to be added
TYPE:
|
pdt
|
dict, the description of the products to be added into the catalog "cat_name"
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
None
|
Updated attribute "cat_name" |
remove_product
Remove a target products "pdt_name" from a catalog "cat_name"
| PARAMETER | DESCRIPTION |
|---|---|
cat_name
|
str, the name of the target catalog
TYPE:
|
pdt_name
|
str, the name of the target products to be removed
TYPE:
|
pdt_category
|
str, the class/category of the products to be updated
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
None
|
Updated attribute "cat_name" |
works
Action
Construction products, this one is picked up in a catalog
| PARAMETER | DESCRIPTION |
|---|---|
act_schemas_dir
|
path, the path of the directory containing the action templates
TYPE:
|
instantiate_action
This method initialize an action, adding it to the class under the attribute "act_name" and described by the
given json schema
| PARAMETER | DESCRIPTION |
|---|---|
act_name
|
str, the name of the action
TYPE:
|
act_category
|
str, the category of the action, typically WallModification or WindowModification
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
None
|
Updated class with new attribute "act_name" |
set_action
Given an action "act_name", set_action modify the value of a parameter described by it name key_kv1 (and eventually key_lv2) and its value val. The method check whether the key_lv1 and key_lv2 are consistent with the action schema
| PARAMETER | DESCRIPTION |
|---|---|
act_name
|
str, the name of the action to be added
TYPE:
|
val
|
the value of the parameter to be set
TYPE:
|
key_lv1
|
the name of the parameter to be set
TYPE:
|
key_lv2
|
the sub-name of the parameter to be set
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
None
|
Updated attributed "act_name" |
update_action
Given an action "act_name", set_action modify the value of a parameter described by it name key_kv1 (and eventually key_lv2) and its value val. The method check whether the key_lv1 and key_lv2 are consistent with the action schema
| PARAMETER | DESCRIPTION |
|---|---|
act
|
the original description of action "act_name"
TYPE:
|
val
|
the value of the parameter to be set
TYPE:
|
key_lv1
|
the name of the parameter to be set
TYPE:
|
key_lv2
|
the sub-name of the parameter to be set
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
act
|
the updated description of action "act_name"
TYPE:
|
add_action
Given an action description through "act" dictionary, this method adds it to the class following the formalism given by the schema : for every parameter (key_lv1) and sub-parameter (key_lv2), the set_action function writes the param-value couple into the class attribute "act_name".
| PARAMETER | DESCRIPTION |
|---|---|
act_name
|
str, the name of the action to be added
TYPE:
|
act_category
|
str, the action category, typically wall modification or window modification
TYPE:
|
act
|
dict, the object containing the description of the action. It has to be consistent with the schema
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
None
|
Updated attribute "act_name" |
remove_n_layers
remove_n_layers(
engine_ep,
act_name,
new_construction,
new_construction_suffix="_REFURBISHED",
target_construction_name=None,
target_surface_names=None,
layer_to_remove_indexes=None,
)
This method
1/ takes an Energy+ Construction object and remove some layers according to layer_to_remove_indexes based on the _remove_nlayers method. A copy of the original Construction is done in order that only the wanted target_surface_names are modified 2/ updates the name of the Construction used for every wall in the target_surface_names list
| PARAMETER | DESCRIPTION |
|---|---|
engine_ep
|
class, containing the Energy+ model given on an idf file format and methods to handle it, all
TYPE:
|
act_name
|
str, the name of the current action
TYPE:
|
new_construction
|
bool, if this action is in continuation of another one (typically remove_nlayers), set True and
TYPE:
|
new_construction_suffix
|
str, if new_Construction is True, this parameter specify the suffix of the Construction name
TYPE:
|
target_construction_name
|
str, the name of the Construction to be modified by the current action
TYPE:
|
target_surface_names
|
list of str, the list of the walls for which the Construction is going to be modified
TYPE:
|
layer_to_remove_indexes
|
list of int, the positions of the Material/layers to be removed
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
None
|
Updated Energy+ idf file |
add_n_layers
add_n_layers(
engine_ep,
act_name,
catalog,
cat_name,
new_construction,
new_construction_suffix="_REFURBISHED",
target_construction_name=None,
target_surface_names=None,
layer_insert=None,
)
This method adds all the Materials in "Materials" at the correct position of the given Construction target_Construction_name. Then it updated the wanted target_surface_names to ensure they are using the resulting Construction
| PARAMETER | DESCRIPTION |
|---|---|
engine_ep
|
class, containing the Energy+ model given on an idf file format and methods to handle it, all
TYPE:
|
act_name
|
the action name, possibly None if the action detailed are pass through the args "Materials"
TYPE:
|
catalog
|
the catalog class objects
TYPE:
|
cat_name
|
the catalog name
TYPE:
|
new_construction
|
if this action is in continuation of another one (typically remove_nlayers), set True and
TYPE:
|
new_construction_suffix
|
if this action is not in the continuation of another one, set properly
TYPE:
|
target_construction_name
|
the name of the Construction to be modified by the current action
TYPE:
|
target_surface_names
|
the list of the walls for which the Construction is going to be modified
TYPE:
|
layer_insert
|
the layer Materials to be inserted and their position
TYPE:
|
Returns:
set_reversed_layers_if_necessary
The fonction get the layers of REFURBISHED construction and set them in reversed order into a construction named xxx_REFURBISHED_Rev created beforehand. This is mandatory when a wall is shared between 2 thermal zones, one zone sees the initial construction, the other its reversed state. Args: engine_ep: class, containing the Energy+ model given on an idf file format and methods to handle it, all based on the eppy package constr_ex: EP Object, Modified construction
Returns: None
set_hvac_system
set_hvac_system(
engine_ep,
services_mapping,
hvac_system_name,
services,
catalog,
cat_name,
target_hvac_system_name,
)
| PARAMETER | DESCRIPTION |
|---|---|
engine_ep
|
class, containing the Energy+ model given on an idf file format and methods to handle it, all
TYPE:
|
services_mapping
|
dictionary giving for each service : - the system supplying it and - the function to compute it
TYPE:
|
hvac_system_name
|
the name of the HVAC system to be added in the Energy+ idf file and the _hvac.json file
|
services
|
The service names concerned by the HVAC system modification
TYPE:
|
catalog
|
the catalog class objects
TYPE:
|
cat_name
|
the catalog in which the fenestration has to be found
TYPE:
|
target_hvac_system_name
|
the name of the hvac systems to be refurbished
TYPE:
|
Returns:
Work
Bases: Action
When the renovation work require a Construction products, this one is picked up in a catalog
| PARAMETER | DESCRIPTION |
|---|---|
duration
|
Project lifetime in years.
TYPE:
|
act_schema_dir
|
the path of the directory containing the action schemas
TYPE:
|
wks_schema_dir
|
the path of the directory containing the works schemas
TYPE:
|
instantiate_works
This method initialize a work, adding it to the class under the attribute "wks_name" and described by the given json schema
| PARAMETER | DESCRIPTION |
|---|---|
engine_ep
|
class, containing the Energy+ model given on an idf file format and methods to handle it, all
TYPE:
|
services
|
dictionary giving for each service : - the system supplying it and - the function to compute it
TYPE:
|
wks_name
|
str, the name of the work
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
None
|
Updated class with new attribute "wks_name" |
remove_n_layers_work
remove_n_layers_work(
act_name,
act_dict,
new_construction=True,
new_construction_suffix="_REFURBISHED",
)
This method add the remove layers action into the work class, run the remove_n_layers function then update the metrics (economics, environmental, etc.) of the class
| PARAMETER | DESCRIPTION |
|---|---|
act_name
|
the name of the action to be run
TYPE:
|
act_dict
|
the description of the action, must follow the schema in .\Action_schemas
TYPE:
|
new_construction
|
if true, a new Construction will be added into the energy+ model, as a modification of
TYPE:
|
new_construction_suffix
|
the name of the new_Construction in case where new_Construction is True
TYPE:
|
Returns:
add_n_layers_work
add_n_layers_work(
catalog,
act_name,
act_dict,
cat_name,
target_construction_name=None,
new_construction=True,
new_construction_suffix="_REFURBISHED",
)
This method add the add layers action into the work class, run the add_n_layers function then update the metrics (economics, environmental, etc.) metrics of the class
| PARAMETER | DESCRIPTION |
|---|---|
catalog
|
the catalog class objects
TYPE:
|
act_name
|
the name of the action to be run
TYPE:
|
act_dict
|
the description of the action, must follow the schema in .\Action_schemas
TYPE:
|
cat_name
|
the name of the catalog in which the Materials have to be picked up
TYPE:
|
target_construction_name
|
the name of the Construction to be refurbished
TYPE:
|
new_construction
|
if true, a new Construction will be added into the energy+ model, as a modification of
TYPE:
|
new_construction_suffix
|
the name of the new_Construction in case where new_Construction is True
TYPE:
|
Returns:
modify_walls
modify_walls(
catalog,
cat_name,
remove_layers_dict,
add_layers_dict,
rmv_action_name="RemoveLayers",
add_action_name="AddLayers",
newconstrsuffix="_REFURBISHED",
)
This method combines removing and adding layer actions in order to represent a real wall refurbishment work. It first modifies the idf file according to both actions, then calculate the action global detailed economics and environmental costs
| PARAMETER | DESCRIPTION |
|---|---|
catalog
|
the catalog class objects
TYPE:
|
cat_name
|
str, the name of the catalog in which the Material has to be picked up
TYPE:
|
remove_layers_dict
|
dict, the description of the removing layers action
TYPE:
|
add_layers_dict
|
dict, the description of the adding layers action
TYPE:
|
rmv_action_name
|
str, the name of the removing layers action
TYPE:
|
add_action_name
|
str, the name of the adding layers action
TYPE:
|
newconstrsuffix
|
str, the suffix to be added to the construction to be modified
TYPE:
|
Returns:
modify_fenestration
modify_fenestration(
catalog,
cat_name,
rpl_windows_dict,
rpl_windows_action_name="ReplaceWindows",
)
This method is based on the _set_fenestration action in order to represent a real window refurbishment work. It first modifies the idf file according to this action, then calculate the action global detailed economics and environmental costs
| PARAMETER | DESCRIPTION |
|---|---|
catalog
|
the catalog class objects
TYPE:
|
cat_name
|
str, the name of the catalog in which the window Material has to be picked up
TYPE:
|
rpl_windows_dict
|
dict, the description of the window replacement action
TYPE:
|
rpl_windows_action_name
|
str, the name of the window replacement action
TYPE:
|
Returns:
modify_hvac
This method is based on the _set_fenestration action in order to represent a real window refurbishment work. It first modifies the idf file according to this action, then calculate the action global detailed economics and environmental costs
| PARAMETER | DESCRIPTION |
|---|---|
catalog
|
the catalog class objects
TYPE:
|
cat_name
|
str, the name of the catalog in which the window Material has to be picked up
TYPE:
|
rpl_hvac_dict
|
dict, the description of the HVAC system replacement action
TYPE:
|
rpl_hvac_action_name
|
str, the name of the HVAC system replacement action
TYPE:
|
Returns:
update_metric
This method calculate the cumulated costs of all the actions carried out on the same building. It updates the description of economics/environmental metrics at the work level
| PARAMETER | DESCRIPTION |
|---|---|
metric
|
str, the name of the metrics to be updated. At the moment, only Economics and Environmental
TYPE:
|
Returns:
Uncertainties
instantiate_modifications
This method initialize a set of modifications due to uncertainties, adding it to the class under the attribute "unc_name" and described by the given json schema
| PARAMETER | DESCRIPTION |
|---|---|
engine_ep
|
class, containing the Energy+ model given on an idf file format and methods to handle it, all
TYPE:
|
unc_name
|
str, the name of the uncertainties set
TYPE:
|
unc_category
|
str, the category of the uncertainty, typically Economics, Occupancy, Weather, Ground or AirRenewal
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
None
|
Updated class with new attribute "unc_name" |
delete_occupant_idf
The idf file is developed for the maximum occupants' Gauge in the building, this function allows to delete some of them according to the occupation scenario running Args: external_schedules: idf ExternalInterface MockUP or Output:Variable objects search_strings: lists of string to be searched for nb_agents: maximum occupants' Gauge, int attribute: string corresponding to the attribute in the idf object overlooked
Returns: Nothing
set_modify_wall_args
Split an action on walls into two parts, the first one relative to add layers only and the second one to remove layers only
| PARAMETER | DESCRIPTION |
|---|---|
act_name
|
action name
TYPE:
|
act
|
action full description
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
rmv_action_name
|
the name of the partial action relative to the "remove layers" part
TYPE:
|
removelayers_dict
|
the description of the partial action relative to the "remove layers" part
TYPE:
|
add_action_name
|
the name of the partial action relative to the "add layers" part
TYPE:
|
addlayers_dict
|
the description of the partial action relative to the "add layers" part
TYPE:
|
oreni.cost_functions
oreni.cost_functions
oreni.cost_functions
CostFunction
CostComfort_AgentModel
CostComfort
Bases: CostFunction
calculate_DH_occupant_walk
This function calculates the °C.H for feeling hot above EN 16798-1 Category I of comfort Args: df: Pandas DataFrame, issued from csv files rooms_corresp: a dict where the numbers depicting rooms in NoMASS are linked to the actual names depicting those rooms. As an example: {1: "KITCHEN", 2: "LIVINGROOM", 3: "BATHROOM", 4: "MASTERBEDROOM", 5: "BEDROOM", 6: "OFFICE"}
Returns:
CostComfort_PMV_RoomLevel
CostComfort
Bases: CostFunction
compute_hourly_comfort
Compute hourly PMV and PPD by estimating indoor relative humidity assuming indoor absolute humidity equals outdoor absolute humidity.
| PARAMETER | DESCRIPTION |
|---|---|
df
|
must contain: - 'ta' (indoor air temperature, °C), - 'tr' (mean radiant temperature, °C), - 'tdp_ext' (outdoor dew point temperature, °C), - 'p_atm' (atmospheric pressure, Pa).
TYPE:
|
met
|
metabolic rate (met).
TYPE:
|
clo
|
clothing insulation (clo).
TYPE:
|
air_speed
|
air speed (m/s).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DataFrame
|
pd.DataFrame: input DataFrame with added columns: - 'RH_int' (indoor relative humidity, %), - 'PMV' (predicted mean vote), - 'PPD' (predicted percentage dissatisfied, %). |
aggregate_annual_comfort
Aggregate hourly comfort metrics into annual indicators.
Args: df (pd.DataFrame): must contain columns 'PMV' and 'PPD'.
dict: annual comfort indicators: - 'mean_PMV', - 'mean_PPD', - 'discomfort_hours_percentage' (PMV < -0.5 or > 0.5), - 'weighted_PPD_factor' (average discomfort factor).
CostEnergyConsumption
CostEnergyConsumption
Bases: CostFunction
- the system supplying it and
- the function to compute it
catalog_hvac: catalog of hvac products output_step:
CostEnergyNeeds
CostEnergyNeeds
CostLifeCycleAssessment
CostLifeCycleAssessment
Bases: CostFunction
cat_name: the name of the catalog in which information relative to the products has to be looked for energies_data: path toward a dictionary giving for each energy (vector) its unitary cost and CO2 emissions output_step: the Energy+ output data time step
compute
| PARAMETER | DESCRIPTION |
|---|---|
output_of_run_EP
|
outputs of EnergyPlusforOptim.run_ep
|
Returns: the life cycle assessment (CO2 emissions) of one building renovation alternative
get_annual_maintenance_co2emissions
Args: Returns: total annual CO2 emissions due maintenance operations
get_annual_energy_consumption_co2emissions
Args: Returns: annual energy consumption cost for every service in self.services
life_cycle_assessment
life_cycle_assessment(
initial_impact,
duration,
services_impact,
maintenance_impact,
replacements_impact,
)
Calculate the total life cycle assessment (LCA) of a renovation project. At the moment, it only takes into account CO2 emissions
| PARAMETER | DESCRIPTION |
|---|---|
initial_impact
|
Initial environmental impact of the project (materials + works).
TYPE:
|
duration
|
Analysis period in years.
TYPE:
|
services_impact
|
Annual environmental impact of energy consumptions.
TYPE:
|
maintenance_impact
|
Annual environmental impact of operating and maintaining the system.
TYPE:
|
replacements_impact
|
array of impacts, each index being the year of replacements/major maintenance.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Total life cycle CO2 emissions over the specified duration.
TYPE:
|
CostLifeCycleCost
CostLifeCycleCost
CostLifeCycleCost(
catalog,
cat_name,
inflation_energies,
inflation_maintenance,
inflation_replacement,
energies_data,
duration=50,
discount_rate=0.03,
output_step="TimeStep",
)
Bases: CostFunction
cat_name: the name of the catalog in which information relative to the products has to be looked for inflation_energies: dict[float or array of float] giving for every energy, the inflation rate its annual expenses. If one float is given, the same inflation rate will be used for the whole calculation over the duration inflation_maintenance: float or array of float giving the inflation rate for annual maintenance expenses. If one float is given, the same inflation rate will be used for the whole calculation over the duration inflation_replacement: float or array of float giving the inflation rate for annual replacement expenses. If one float is given, the same inflation rate will be used for the whole calculation over the duration energies_data: path toward a dictionary giving for each energy (vector) its unitary cost and CO2 emissions duration: time duration of the calculation (typically 30 or 50 years) discount_rate: the discount rate (>0) output_step: the Energy+ output data time step
compute
| PARAMETER | DESCRIPTION |
|---|---|
output_of_run_EP
|
outputs of EnergyPlusforOptim.run_ep
|
Returns: the life cycle cost of one building renovation alternative
get_annual_services_cost
Args: Returns: annual energy consumption cost for every service in self.services
get_inflation
Retrieve the inflation value for a given year.
| PARAMETER | DESCRIPTION |
|---|---|
inflation
|
Either a constant inflation rate or an array of inflation values.
TYPE:
|
year
|
Year for which to retrieve the inflation (1-based index).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Inflation rate for the specified year.
TYPE:
|
discount
Discount a future value to its present value using the real discount rate.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
Future cost to be discounted.
TYPE:
|
discount_rate
|
Nominal annual discount rate (e.g., 0.03 for 3%).
TYPE:
|
year
|
Number of years in the future the cost occurs.
TYPE:
|
inflation
|
Inflation rate(s). Can be constant or vary yearly. Defaults to 0.0.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Present value of the future cost.
TYPE:
|
discounted_sum
Generic function to compute the discounted sum of values over time.
| PARAMETER | DESCRIPTION |
|---|---|
duration
|
Number of years.
TYPE:
|
cost_function
|
Function returning the cost for a given year (1-based).
TYPE:
|
discount_rate
|
Nominal annual discount rate.
TYPE:
|
inflation
|
Inflation rate(s). Defaults to 0.0.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Total discounted value.
TYPE:
|
operating_maintenance_cost
Compute discounted cost of maintenance over time.
| PARAMETER | DESCRIPTION |
|---|---|
duration
|
Number of years the cost occurs.
TYPE:
|
annual_cost
|
Cost incurred each year.
TYPE:
|
discount_rate
|
Nominal annual discount rate.
TYPE:
|
inflation
|
Inflation rate(s) for O&M costs. Defaults to 0.0.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Present value of total O&M costs over the duration.
TYPE:
|
operating_energies_cost
Calculate the present value of recurring annual operating and maintenance costs.
| PARAMETER | DESCRIPTION |
|---|---|
duration
|
Number of years the cost occurs.
TYPE:
|
services_cost
|
Cost incurred each year.
TYPE:
|
discount_rate
|
Nominal annual discount rate.
TYPE:
|
inflation
|
Inflation rate(s) for energy costs. Defaults to 0.0.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Present value of total energy costs over the building lifespan.
TYPE:
|
replacement_cost
Compute discounted cost of replacements/ major maintenance, either constant or yearly array.
| PARAMETER | DESCRIPTION |
|---|---|
duration
|
Project lifetime in years.
TYPE:
|
replacements
|
TYPE:
|
discount_rate
|
Nominal annual discount rate.
TYPE:
|
inflation
|
Inflation rate(s) for replacements. Defaults to 0.0.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Present value of total replacement/maintenance costs.
TYPE:
|
life_cycle_cost
life_cycle_cost(
initial_cost,
duration,
services_cost,
maintenance_cost,
replacements_cost,
discount_rate,
inflation_energies,
inflation_maintenance=0.0,
inflation_replacement=0.0,
)
Calculate the total life cycle cost (LCC) of a renovation project.
| PARAMETER | DESCRIPTION |
|---|---|
initial_cost
|
Initial capital cost of the project.
TYPE:
|
duration
|
Analysis period in years.
TYPE:
|
services_cost
|
energy consumption cost for each service.
TYPE:
|
maintenance_cost
|
Annual cost of operating and maintaining the system.
TYPE:
|
replacements_cost
|
array of costs, each index being the year of replacements/major maintenance.
TYPE:
|
discount_rate
|
Nominal annual discount rate.
TYPE:
|
inflation_energies
|
Inflation rate(s) for energies costs. Defaults to 0.0.
TYPE:
|
inflation_maintenance
|
Inflation rate(s) for maintenance costs. Defaults to 0.0.
TYPE:
|
inflation_replacement
|
Inflation rate(s) for replacements. Defaults to 0.0.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Total discounted life cycle cost over the specified duration.
TYPE:
|
oreni.uncertainties
oreni.uncertainties
oreni.uncertainties
UncertainSpace
UncertainSpace
get_columns
Builds a pandas MultiIndex from the uncertain spaces stored in self.uncertain_space. For each uncertain space, the first level is the uncertainty name (from "Name") and the second level is the alias list defined in the uncertain space description (the "Alias" field). This method extracts the alias names directly.
oreni.engine
oreni.engine
oreni.engine
EnergyPlus
EnergyPlus
Bases: Engine
getObjectFields
This function takes an object type and an IDD file, and returns the fields, their type, and any possible keys for the given object type, in the form of a dictionary.
| PARAMETER | DESCRIPTION |
|---|---|
object_type
|
The type of the object to query.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Dict
|
A dictionary containing either the fields with their types and keys, or an error message if the object type is not found.
TYPE:
|
SetAndRun1Simulation
SetAndRun1Simulation
SetAndRun1Simulation(
duration,
run_dir,
idf_path,
epw_path,
services_path,
root_path,
fmu_path=None,
output_step="Hourly",
save_idf=False,
save_csv=False,
debug=False,
)
- run the resulting model
- compute various cost functions, some of them using the simulation results
Args:
duration: the building’s service life before deconstruction, in years run_dir: the directory in which the Energy+ model is going to be run idf_path: the absolute path to the original Energy+ model epw_path: the absolute path to the weather file services_path: the absolute path to the json file describing the HVAC systems x services root_path: optional, the directory in which the source code can be found fmu_path: the absolute path to the fmu file, only for the cases where agent based occupancy model is used output_step: the time step of the Energy+ outputs (usually Hourly or Timestep) save_idf: if True, the modified .idf file will be saved save_csv: if True, the results csv file will be saved debug: if yes, print debug info del_wks: if True, the WorksXUncertainties class instance will be removed from the current class
instantiate_uncertain_design_problem
decision space + catalog,
cost functions, and uncertain space. Then, it instantiates the WorkXUncertainties class enabling the representation of building + context modifications
| PARAMETER | DESCRIPTION |
|---|---|
actions
|
the list of refurbishment action to be combined and applied to the building
TYPE:
|
cost_functions
|
the objective functions to be optimized
TYPE:
|
catalog
|
the catalog used by the optimization process
TYPE:
|
cat_name
|
the catalog name
TYPE:
|
metrics
|
the list of quantities/evaluations to be updated while running the refurbishment actions
TYPE:
|
Returns:
instantiate_uncertain_works_framework
This function : - instantiates and initializes the Energy+ model wrapper (eppy object class) with the given .idf and epw. files. - Load the services description from the json file - instantiates the class (WorksXUncertainties) to handle and modify a building retrofit project
| PARAMETER | DESCRIPTION |
|---|---|
wksXunc_name
|
the name of one simulation
TYPE:
|
Returns:
set_action_j_from_design_i
From the i-th refurbishment design (in design_i), and the j_th retrofit action (in decision_space_dim_j), this function build an action dictionary fully described
| PARAMETER | DESCRIPTION |
|---|---|
design_i
|
the i-th design is a set of renovation actions
TYPE:
|
decision_space_dim_j
|
the j-th renovation action of the i-th design
TYPE:
|
act_name
|
the name of the j-th renovation action of the i-th design
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
action
|
a dictionary containing the full description of a refurbishment action
TYPE:
|
construct_input_1action
Considering that one simulation ("simulation") is a combination of different action, this method set the Energy+ .idf file to hold one action, given by its name "act_name" and description "act"
| PARAMETER | DESCRIPTION |
|---|---|
act_name
|
the name of the action to be run
TYPE:
|
action
|
the description of the static (unchanged while optimizing) and variable (change according to the
TYPE:
|
cat_name
|
the name of the catalog to be used
TYPE:
|
Returns:
construct_input_1design_static
Considering that an experience design is a set of several simulations, itself a combination of different actions, this method set one Energy+ .idf file to hold each action of the simulation "design_num", and update the linked evaluation metrics
| PARAMETER | DESCRIPTION |
|---|---|
cat_name
|
the name of the catalog to be used
TYPE:
|
metrics
|
the list of evaluations to be updated while running the refurbishment actions
TYPE:
|
Returns:
run_ep
Run Energy+ simulation for file_name .idf file modified according to information given by experience_i_design
| PARAMETER | DESCRIPTION |
|---|---|
file_name
|
the name to be given to the i-th simulation
TYPE:
|
output_directory
|
the directory path for the simulation outputs
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
output_directory
|
the directory path for the simulation outputs
TYPE:
|
file_name
|
the name to be given to the i-th simulation
TYPE:
|
run_dir
|
the directory of running simulation
TYPE:
|
idf_to_return
|
the resulting idf eppy object
TYPE:
|
SetAndRunSimulations
SetAndRunSimulations
SetAndRunSimulations(
duration,
run_dir,
idf_path,
epw_path,
services_path,
root_path,
fmu_path=None,
output_step="Hourly",
save_idf=False,
save_csv=False,
debug=False,
del_wks=True,
)
- run the resulting model
- compute various cost functions, some of them using the simulation results
Args:
duration: the building’s service life before deconstruction, in years run_dir: the directory in which the Energy+ model is going to be run idf_path: the absolute path to the original Energy+ model epw_path: the absolute path to the weather file services_path: the absolute path to the json file describing the HVAC systems x services root_path: optional, the directory in which the source code can be found fmu_path: the absolute path to the fmu file, only for the cases where agent based occupancy model is used output_step: the time step of the Energy+ outputs (usually Hourly or Timestep) save_idf: if True, the modified .idf file will be saved save_csv: if True, the results csv file will be saved debug: if yes, print debug info del_wks: if True, the WorksXUncertainties class instance will be removed from the current class
instantiate_uncertain_design_problem
instantiate_uncertain_design_problem(
decision_space,
uncertain_space,
cost_functions,
catalog,
cat_name,
metrics,
)
decision space + catalog,
cost functions, and uncertain space. Then, it instantiates the WorkXUncertainties class enabling the representation of building + context modifications
| PARAMETER | DESCRIPTION |
|---|---|
decision_space
|
object class describing the set of retrofit actions
TYPE:
|
uncertain_space
|
object class describing the set of uncertainties
TYPE:
|
cost_functions
|
the objective functions to be optimized
TYPE:
|
catalog
|
the catalog used by the optimization process
TYPE:
|
cat_name
|
the catalog name
TYPE:
|
metrics
|
the list of quantities/evaluations to be updated while running the refurbishment actions
TYPE:
|
Returns:
instantiate_uncertain_works_framework
This function : - instantiates and initializes the Energy+ model wrapper (eppy object class) with the given .idf and epw. files. - Load the services description from the json file - instantiates the class (WorksXUncertainties) to handle and modify a building retrofit project
| PARAMETER | DESCRIPTION |
|---|---|
wksXunc_name
|
the name of one simulation
TYPE:
|
Returns:
set_action_j_from_design_i
From the i-th refurbishment design (in design_i), and the j_th retrofit action (in decision_space_dim_j), this function build an action dictionary fully described
| PARAMETER | DESCRIPTION |
|---|---|
design_i
|
the i-th design is a set of renovation actions
TYPE:
|
decision_space_dim_j
|
the j-th renovation action of the i-th design
TYPE:
|
act_name
|
the name of the j-th renovation action of the i-th design
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
action
|
a dictionary containing the full description of a refurbishment action
TYPE:
|
set_uncertainty_i_from_var_j
From the i-th uncertainties draw (in uncertain_draw_i), and the j_th uncertainty of this draw (in uncertain_space_dim_j), this function build an uncertainty dictionary fully defined
| PARAMETER | DESCRIPTION |
|---|---|
uncertain_draw_i
|
the i-th draw of uncertainties set
TYPE:
|
uncertain_space_dim_j
|
the j-th uncertainty of the i_th uncertain draw
TYPE:
|
unc_name
|
the name of the j-th uncertainty of the i_th uncertain draw
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
uncertainty
|
a dictionary containing the full description of an uncertainty
TYPE:
|
construct_input_uncertainty
Considering that one simulation "i" is a combination of different uncertainties, this method set the Energy+ .idf file to hold one uncertainty, given by its name "unc_name" and description from uncertain_space_dim_j and uncertainties_draw_i
| PARAMETER | DESCRIPTION |
|---|---|
unc_name
|
the name of the j-th uncertainty of the i_th uncertain draw
TYPE:
|
uncertain_space_dim_j
|
the j-th uncertainty of the i_th uncertain draw
TYPE:
|
uncertainties_draw_i
|
the i-th draw of uncertainties set
TYPE:
|
Returns:
construct_input_1uncertaintiesdraw
| PARAMETER | DESCRIPTION |
|---|---|
uncertainties_i
|
the set of uncertainties to be combined and applied to the building retrofit project, for the i_th simulation
TYPE:
|
Returns:
construct_input_1action
Considering that one simulation is a combination of different actions, this function set the Energy+ .idf file to hold one action, given by its name "act_name" and description from decision_space_dim_j and experience_design_i
| PARAMETER | DESCRIPTION |
|---|---|
act_name
|
the name of the j-th renovation action of the i-th design
TYPE:
|
decision_space_dim_j
|
the j-th renovation action of the i-th design
TYPE:
|
experience_design_i
|
the i-th design is a set of renovation actions
TYPE:
|
cat_name
|
the name of the catalog to be used
TYPE:
|
Returns:
construct_input_1design
Considering that an experience design is a set of several simulations, itself a combination of different actions, this method set one Energy+ .idf file to hold each action of the experience_i_design and update the assessment metrics
| PARAMETER | DESCRIPTION |
|---|---|
experience_design_i
|
the set of refurbishment action to be combined and applied to the building
TYPE:
|
cat_name
|
the name of the catalog to be used
TYPE:
|
metrics
|
the list of assessments to be updated while running the refurbishment actions
TYPE:
|
Returns:
run_ep
Run Energy+ simulation for file_name .idf file modified according to information given by experience_i_design
| PARAMETER | DESCRIPTION |
|---|---|
use_energyplus_api
|
TYPE:
|
uncertain_experience_i
|
the i-th set of refurbishment actions and uncertainties to be combined and applied to the building
TYPE:
|
file_name
|
the name to be given to the i-th simulation
TYPE:
|
output_directory
|
the directory path for the simulation outputs
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
experience_i_design
|
the i-th set of refurbishment actions
TYPE:
|
uncertainties_i
|
the i-th set of uncertainties
TYPE:
|
output_directory
|
the directory path for the simulation outputs
TYPE:
|
file_name
|
the name to be given to the i-th simulation
TYPE:
|
run_dir
|
the directory of running simulation
TYPE:
|
idf_to_return
|
the resulting idf eppy object
TYPE:
|
compute_cost_functions
| PARAMETER | DESCRIPTION |
|---|---|
xu_batch
|
the input data to be set in the .idf file Energy+ model - design part x uncertainty part
TYPE:
|
iteration
|
the index of the simulation
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
cost
|
the refurbishment works assessment according to one or several cost functions
TYPE:
|
oreni.optim
oreni.optim
oreni.optim
DiscreteVariableEncoder
Encoder for discrete unordered variables to work with BoTorch.
BoTorch requires continuous variables, so we encode discrete variables using one-hot encoding or integer encoding with appropriate bounds.
botorch_multi_objective_optimizer
botorch_multi_objective_optimizer(
function,
decision_space,
uncertain_space,
function_labels,
n_initial_points=10,
n_optimization_iterations=20,
n_uncs=10,
n_occ_rdm=1,
n_jobs=cpu_count() - 1,
acquisition_function="qEHVI",
reference_point=None,
batch_size=1,
raw_samples=512,
num_restarts=10,
)
Multi-objective optimization using BoTorch with support for discrete unordered variables.
| PARAMETER | DESCRIPTION |
|---|---|
function
|
Function to optimize (should return list of objective values)
TYPE:
|
decision_space
|
Decision space definition
TYPE:
|
uncertain_space
|
Uncertain space definition (optional)
TYPE:
|
function_labels
|
Labels for objective functions
TYPE:
|
n_initial_points
|
Number of initial random points for exploration
TYPE:
|
n_optimization_iterations
|
Number of optimization iterations
TYPE:
|
n_uncs
|
Number of uncertainty samples per design
TYPE:
|
n_occ_rdm
|
Number of occupancy samples per uncertainty
TYPE:
|
n_jobs
|
Number of parallel jobs
TYPE:
|
acquisition_function
|
Type of acquisition function ("qEHVI", "qNEHVI", etc.)
TYPE:
|
reference_point
|
Reference point for hypervolume calculation
TYPE:
|
batch_size
|
Batch size for parallel evaluation
TYPE:
|
raw_samples
|
Number of random samples for acquisition function optimization (higher = more robust but slower)
TYPE:
|
num_restarts
|
Number of optimization restarts for acquisition function optimization
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tuple[DataFrame, DataFrame, DataFrame]
|
Tuple of (uncertain_design, experience_design, uncertain_draws) |
botorch_multi_objective_optimizer_kernel
botorch_multi_objective_optimizer_kernel(
function,
decision_space,
uncertain_space,
function_labels,
n_initial_points=10,
n_optimization_iterations=2,
n_uncs=2,
n_occ_rdm=1,
n_jobs=cpu_count() - 1,
acquisition_function="qEHVI",
reference_point=None,
batch_size=1,
raw_samples=512,
num_restarts=10,
kernel_type="mixed",
fallback_to_simple_kernel=True,
)
Multi-objective optimization using BoTorch with support for discrete unordered variables.
| PARAMETER | DESCRIPTION |
|---|---|
function
|
Function to optimize (should return list of objective values)
TYPE:
|
decision_space
|
Decision space definition
TYPE:
|
uncertain_space
|
Uncertain space definition (optional)
TYPE:
|
function_labels
|
Labels for objective functions
TYPE:
|
n_initial_points
|
Number of initial random points for exploration
TYPE:
|
n_optimization_iterations
|
Number of optimization iterations
TYPE:
|
n_uncs
|
Number of uncertainty samples per design
TYPE:
|
n_occ_rdm
|
Number of occupancy samples per uncertainty
TYPE:
|
n_jobs
|
Number of parallel jobs
TYPE:
|
acquisition_function
|
Type of acquisition function ("qEHVI", "qNEHVI", etc.)
TYPE:
|
reference_point
|
Reference point for hypervolume calculation
TYPE:
|
batch_size
|
Batch size for parallel evaluation
TYPE:
|
raw_samples
|
Number of random samples for acquisition function optimization (higher = more robust but slower)
TYPE:
|
num_restarts
|
Number of optimization restarts for acquisition function optimization
TYPE:
|
kernel_type
|
Type of kernel to use ("mixed", "matern", "rbf", "categorical")
TYPE:
|
fallback_to_simple_kernel
|
Whether to fallback to simple RBF kernel on numerical issues
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tuple[DataFrame, DataFrame, DataFrame]
|
Tuple of (uncertain_design, experience_design, uncertain_draws) |
DecisionSpace
DecisionSpace
get_columns
Builds a pandas MultiIndex from the decision spaces stored in self.decision_space. For each decision space, the first level is the action name (from "Name") and the second level is the alias list defined in the decision space description (the "Alias" field). This method extracts the alias names directly.
botorch_optimization
BoTorch-based multi-objective optimization for ORENI framework.
This module provides optimization capabilities using BoTorch for multi-objective optimization with discrete unordered variables, specifically designed for building renovation optimization under uncertainties.
DiscreteVariableEncoder
Encoder for discrete unordered variables to work with BoTorch.
BoTorch requires continuous variables, so we encode discrete variables using one-hot encoding or integer encoding with appropriate bounds.
botorch_multi_objective_optimizer
botorch_multi_objective_optimizer(
function,
decision_space,
uncertain_space,
function_labels,
n_initial_points=10,
n_optimization_iterations=20,
n_uncs=10,
n_occ_rdm=1,
n_jobs=cpu_count() - 1,
acquisition_function="qEHVI",
reference_point=None,
batch_size=1,
raw_samples=512,
num_restarts=10,
)
Multi-objective optimization using BoTorch with support for discrete unordered variables.
| PARAMETER | DESCRIPTION |
|---|---|
function
|
Function to optimize (should return list of objective values)
TYPE:
|
decision_space
|
Decision space definition
TYPE:
|
uncertain_space
|
Uncertain space definition (optional)
TYPE:
|
function_labels
|
Labels for objective functions
TYPE:
|
n_initial_points
|
Number of initial random points for exploration
TYPE:
|
n_optimization_iterations
|
Number of optimization iterations
TYPE:
|
n_uncs
|
Number of uncertainty samples per design
TYPE:
|
n_occ_rdm
|
Number of occupancy samples per uncertainty
TYPE:
|
n_jobs
|
Number of parallel jobs
TYPE:
|
acquisition_function
|
Type of acquisition function ("qEHVI", "qNEHVI", etc.)
TYPE:
|
reference_point
|
Reference point for hypervolume calculation
TYPE:
|
batch_size
|
Batch size for parallel evaluation
TYPE:
|
raw_samples
|
Number of random samples for acquisition function optimization (higher = more robust but slower)
TYPE:
|
num_restarts
|
Number of optimization restarts for acquisition function optimization
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tuple[DataFrame, DataFrame, DataFrame]
|
Tuple of (uncertain_design, experience_design, uncertain_draws) |
compute_pareto_frontier
Compute the Pareto frontier from objective values.
| PARAMETER | DESCRIPTION |
|---|---|
objectives
|
Tensor of objective values (n_points, n_objectives)
TYPE:
|
minimize
|
List indicating which objectives to minimize (True) or maximize (False)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tuple[Tensor, Tensor]
|
Tuple of (pareto_objectives, pareto_indices) |
botorch_optimization_kernel
BoTorch-based multi-objective optimization for ORENI framework.
This module provides optimization capabilities using BoTorch for multi-objective optimization with discrete unordered variables, specifically designed for building renovation optimization under uncertainties.
DiscreteVariableEncoder
Encoder for discrete unordered variables to work with BoTorch.
BoTorch requires continuous variables, so we encode discrete variables using one-hot encoding or integer encoding with appropriate bounds.
botorch_multi_objective_optimizer_kernel
botorch_multi_objective_optimizer_kernel(
function,
decision_space,
uncertain_space,
function_labels,
n_initial_points=10,
n_optimization_iterations=2,
n_uncs=2,
n_occ_rdm=1,
n_jobs=cpu_count() - 1,
acquisition_function="qEHVI",
reference_point=None,
batch_size=1,
raw_samples=512,
num_restarts=10,
kernel_type="mixed",
fallback_to_simple_kernel=True,
)
Multi-objective optimization using BoTorch with support for discrete unordered variables.
| PARAMETER | DESCRIPTION |
|---|---|
function
|
Function to optimize (should return list of objective values)
TYPE:
|
decision_space
|
Decision space definition
TYPE:
|
uncertain_space
|
Uncertain space definition (optional)
TYPE:
|
function_labels
|
Labels for objective functions
TYPE:
|
n_initial_points
|
Number of initial random points for exploration
TYPE:
|
n_optimization_iterations
|
Number of optimization iterations
TYPE:
|
n_uncs
|
Number of uncertainty samples per design
TYPE:
|
n_occ_rdm
|
Number of occupancy samples per uncertainty
TYPE:
|
n_jobs
|
Number of parallel jobs
TYPE:
|
acquisition_function
|
Type of acquisition function ("qEHVI", "qNEHVI", etc.)
TYPE:
|
reference_point
|
Reference point for hypervolume calculation
TYPE:
|
batch_size
|
Batch size for parallel evaluation
TYPE:
|
raw_samples
|
Number of random samples for acquisition function optimization (higher = more robust but slower)
TYPE:
|
num_restarts
|
Number of optimization restarts for acquisition function optimization
TYPE:
|
kernel_type
|
Type of kernel to use ("mixed", "matern", "rbf", "categorical")
TYPE:
|
fallback_to_simple_kernel
|
Whether to fallback to simple RBF kernel on numerical issues
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tuple[DataFrame, DataFrame, DataFrame]
|
Tuple of (uncertain_design, experience_design, uncertain_draws) |
random_optimization
set_x_batch
Generates a DataFrame of experience designs based on the decision space and iterations.
Parameters:
decision_space (DecisionSpace): A decision space object containing column definitions and search spaces. n_iters (int, optional): Number of iterations (rows) to generate, default is 1.
Returns:
pd.DataFrame A DataFrame where each column corresponds to a parameter in the decision space, and each row is a sampled set of parameter values.
set_u_batch
Generates a DataFrame (with a pandas MultiIndex for columns) from the uncertainty definitions stored in an UncertainSpace instance. For each uncertainty, the first level of the column index is the uncertainty name and the second level is the alias name as defined in the uncertain space.
For each alias, random samples are drawn according to the sampling law and bounds specified in the uncertain space (under the "Space" key). This method supports both continuous (normal/uniform) and discrete sampling.
| PARAMETER | DESCRIPTION |
|---|---|
uncertain_space
|
An instance of your UncertainSpace class.
TYPE:
|
n_uncs
|
The number of iterations (rows) to generate.
TYPE:
|
n_occ_rdm
|
The number of iterations (rows) linked to SeedValue of FMU NoMASS to generate.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DataFrame
|
pd.DataFrame: A DataFrame with MultiIndex columns and n_iters rows. |
oreni.models.energyplus
oreni.models.energyplus
oreni.models.energyplus
EnergyPlusModel
Class and functions for accessing EnergyPlus Python API
EnergyPlusModel
Bases: EnergyPlusModel
EnergyPlus Model object
| ATTRIBUTE | DESCRIPTION |
|---|---|
walls_window |
list of walls with windows
|
floors |
list of floors
|
lighting_zone |
list of lighting zones
|
zones |
list of zones
|
add_lighting
Add lighting object to EnergyPlusModel's epjs dictionary.
| PARAMETER | DESCRIPTION |
|---|---|
zone
|
Zone name to add lighting to.
TYPE:
|
lighting_level
|
Lighting level in Watts.
TYPE:
|
replace
|
If True, replace existing lighting object in zone.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If zone not found in model. |
ValueError
|
If lighting already exists in zone and replace is False. |
Examples:
add_output
Add an output variable or meter to the epjs dictionary.
| PARAMETER | DESCRIPTION |
|---|---|
output_type
|
Type of the output. "variable" or "meter".
TYPE:
|
output_name
|
Name of the output variable or meter.
TYPE:
|
reporting_frequency
|
Reporting frequency of the output variable or meter.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If output_type is not "variable" or "meter". |
Examples:
load_idf
Load IDF file as JSON object.
Use EnergyPlus --convert-only option to convert IDF file to epJSON file.
| PARAMETER | DESCRIPTION |
|---|---|
fpath
|
Path to IDF file.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
JSON object. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If file is not an IDF file. |
FileNotFoundError
|
If IDF file not found. |
FileNotFoundError
|
If converted epJSON file not found. |
Examples:
EnergyPlusSetup
Class and functions for accessing EnergyPlus Python API
EnergyPlusSetup
EnergyPlus Simulation Setup.
| ATTRIBUTE | DESCRIPTION |
|---|---|
api |
EnergyPlusAPI object
|
epw |
Weather file path
|
actuator_handles |
Actuator Handles
|
variable_handles |
Variable handles
|
construction_handles |
Construction Handles
|
actuators |
List of actuators available
|
model |
EnergyPlusModel object
|
state |
EnergyPlusState object
|
handles |
Handles object
|
| PARAMETER | DESCRIPTION |
|---|---|
epmodel
|
EnergyPlusModel object
TYPE:
|
weather_file
|
Weather file path. (default: None)
TYPE:
|
Examples:
actuate
Set or update the operating value of an actuator in the EnergyPlus model.
If actuator has not been requested previously, it will be requested. Set the actuator value to the value specified.
| PARAMETER | DESCRIPTION |
|---|---|
component_type
|
The actuator category, e.g. "Weather Data"
TYPE:
|
name
|
The name of the actuator to retrieve, e.g. "Outdoor Dew Point"
TYPE:
|
key
|
The instance of the variable to retrieve, e.g. "Environment"
TYPE:
|
value
|
The value to set the actuator to
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the actuator is not found |
Examples:
actuate_cooling_setpoint
actuate_heating_setpoint
Set heating setpoint for a zone.
| PARAMETER | DESCRIPTION |
|---|---|
zone
|
The name of the zone to set the heating setpoint for.
TYPE:
|
value
|
The value to set the heating setpoint to.
TYPE:
|
Example
epsetup.actuate_cooling_setpoint("zone1", 20)
actuate_lighting_power
actuate_cfs_state
get_variable_value
Get the value of a variable in the EnergyPlus model during runtime. The variable must be requested before it can be retrieved. If this method is called in a callback function, the variable will be requested automatically. So avoid having other methods called get_variable_value in the callback function.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name of the variable to retrieve, e.g. "Outdoor Dew Point"
TYPE:
|
key
|
The instance of the variable to retrieve, e.g. "Environment"
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
The value of the variable |
| RAISES | DESCRIPTION |
|---|---|
KeyError
|
If the key is not found |
ValueError
|
If the variable is not found |
Examples:
get_cfs_state
Return the current complex fenestration state with input window name
| PARAMETER | DESCRIPTION |
|---|---|
window
|
name of the window
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
name of the cfs state |
request_variable
Request a variable from the EnergyPlus model for access during runtime.
| PARAMETER | DESCRIPTION |
|---|---|
name
|
The name of the variable to retrieve, e.g. "Outdoor Dew Point"
TYPE:
|
key
|
The instance of the variable to retrieve, e.g. "Environment"
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
None
|
None |
Examples:
get_datetime
Get the current date and time from EnergyPlus Run time datatime format with iso_8601_format = yes. hour 0-23, minute 10 - 60 v23.2.0
| RETURNS | DESCRIPTION |
|---|---|
datetime
|
datetime object |
run
run(
idf_run="",
output_directory="./",
output_prefix="eplus",
output_suffix="L",
verbose=False,
annual=False,
design_day=False,
)
Run EnergyPlus simulation.
| PARAMETER | DESCRIPTION |
|---|---|
output_directory
|
Output directory path. (default: current directory)
TYPE:
|
output_prefix
|
Prefix for output files. (default: eplus)
TYPE:
|
output_suffix
|
Suffix style for output files. (default: L) L: Legacy (e.g., eplustbl.csv) C: Capital (e.g., eplusTable.csv) D: Dash (e.g., eplus-table.csv)
TYPE:
|
verbose
|
If True, do not logging.info EnergyPlus output to console. (default: False)
TYPE:
|
annual
|
If True, force run annual simulation. (default: False)
TYPE:
|
design_day
|
If True, force run design-day-only simulation. (default: False)
TYPE:
|
Examples:
set_callback
Set callback function for EnergyPlus runtime API.
| PARAMETER | DESCRIPTION |
|---|---|
method_name
|
Name of the method to set callback for.
TYPE:
|
func
|
Callback function.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
AttributeError
|
If method_name is not found in EnergyPlus runtime API. |
Examples:
get_direct_normal_irradiance
ep_datetime_parser
Parse date and time from EnergyPlus output.
| PARAMETER | DESCRIPTION |
|---|---|
inp
|
Date and time string from EnergyPlus output.
TYPE:
|
load_idf
Load IDF file as JSON object.
Use EnergyPlus --convert-only option to convert IDF file to epJSON file.
| PARAMETER | DESCRIPTION |
|---|---|
fpath
|
Path to IDF file.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
JSON object. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If file is not an IDF file. |
FileNotFoundError
|
If IDF file not found. |
FileNotFoundError
|
If converted epJSON file not found. |
Examples:
load_energyplus_model
Load EnergyPlus model from JSON file.
| PARAMETER | DESCRIPTION |
|---|---|
fpath
|
Path to JSON file.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
EnergyPlusModel
|
EnergyPlusModel object. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If file is not an IDF or epJSON file. |
Examples:
utils
try_import_energyplus_api
Try to import pyenergyplus, and add the E+ installation to sys.path if it's not found.
EnergyPlus home can be specified with the ENERGYPLUS_HOME environment variable, in that case path is used as is. If ENERGYPLUS_VERSION is specified, /usr/local/EnergyPlus-{ENERGYPLUS_VERSION} is used (Linux only). Otherwise, the latest E+ installation in /usr/local/EnergyPlus-* is used (Linux only).