Skip to content

Commit

Permalink
0.7.3 - optimisation with besos
Browse files Browse the repository at this point in the history
  • Loading branch information
dsanchez-garcia committed Jan 26, 2024
1 parent 8d51084 commit 65278b5
Show file tree
Hide file tree
Showing 8 changed files with 2,955 additions and 1 deletion.
2,716 changes: 2,716 additions & 0 deletions TestModel_onlyGeometryForVRFsystem_2zones_CalcVent_V2310.idf

Large diffs are not rendered by default.

Empty file removed accim/funcs_for_besos/accis.py
Empty file.
18 changes: 18 additions & 0 deletions accim/funcs_for_besos/param_accis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

def modify_VSToffset(building, value):
import accim.sim.accis_single_idf_funcs as accis
accis.modifyAccis(
idf=building,
ComfStand=1,
CAT=3,
ComfMod=3,
# SetpointAcc=1000,
HVACmode=2,
VentCtrl=0,
CoolSeasonStart='01/02',
CoolSeasonEnd='01/03',
VSToffset=value,
# MinOToffset=50,
# MaxWindSpeed=50
)
return
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
from besos import eppy_funcs as ef
from besos.evaluator import EvaluatorEP
from besos.optimizer import NSGAII
from besos.parameters import RangeParameter, Parameter, GenericSelector
from besos.problem import EPProblem
from besos.objectives import VariableReader, MeterReader

import accim.sim.accis_single_idf_funcs as accis
import accim.funcs_for_besos.param_accis as bf

##

building = ef.get_building('TestModel_onlyGeometryForVRFsystem_2zones_CalcVent_V2310.idf')

accis.addAccis(
idf=building,
ScriptType='vrf_mm',
SupplyAirTempInputMethod='temperature difference',
Output_keep_existing=False,
Output_type='standard',
Output_freqs=['hourly'],
# EnergyPlus_version='9.4',
TempCtrl='temperature',
Output_gen_dataframe=True,
)

##

# def modify_accis(building, value):
# accis.modifyAccis(
# idf=building,
# ComfStand=1,
# CAT=3,
# ComfMod=3,
# # SetpointAcc=1000,
# HVACmode=2,
# VentCtrl=0,
# CoolSeasonStart='01/02',
# CoolSeasonEnd='01/03',
# VSToffset=value,
# # MinOToffset=50,
# # MaxWindSpeed=50
# )
# return

##
parameters_set = [
Parameter(
name='VSToffset',
selector=GenericSelector(set=bf.modify_VSToffset),
value_descriptor=RangeParameter(min_val=0.1, max_val=0.9)
),
]

##

objectives = [
MeterReader("Electricity:Facility", name="Electricity Usage"),
]

evaluator = EvaluatorEP(
problem=EPProblem(
inputs=parameters_set,
outputs=objectives,
minimize_outputs=[
True
],
),
building=building,
)


results1 = NSGAII(evaluator, evaluations=1, population_size=3)
2 changes: 1 addition & 1 deletion accim/sample_files/script_usage/besos_parametric_apmv.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import numpy as np

import accim.sim.apmv_setpoints as apmv
import accim.funcs_for_besos.apmv as bf
import accim.funcs_for_besos.param_apmv as bf



Expand Down
74 changes: 74 additions & 0 deletions besos_parametric_accis_class.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
from besos import eppy_funcs as ef
from besos.evaluator import EvaluatorEP
from besos.optimizer import NSGAII
from besos.parameters import RangeParameter, Parameter, GenericSelector
from besos.problem import EPProblem
from besos.objectives import VariableReader, MeterReader

import accim.sim.accis_single_idf as accis
import accim.funcs_for_besos.param_accis as bf

##

building = ef.get_building('TestModel_onlyGeometryForVRFsystem_2zones_CalcVent_V2310.idf')

x = accis.addAccis(
idf=building,
ScriptType='vrf_mm',
SupplyAirTempInputMethod='temperature difference',
Output_keep_existing=False,
Output_type='standard',
Output_freqs=['hourly'],
# EnergyPlus_version='9.4',
TempCtrl='temperature',
Output_gen_dataframe=True,

)

##

# def modify_accis(building, value):
# x.modifyAccis(
# # idf=building,
# ComfStand=1,
# CAT=3,
# ComfMod=3,
# # SetpointAcc=1000,
# HVACmode=2,
# VentCtrl=0,
# CoolSeasonStart='01/02',
# CoolSeasonEnd='01/03',
# VSToffset=value,
# # MinOToffset=50,
# # MaxWindSpeed=50
# )
# return

##
parameters_set = [
Parameter(
name='VSToffset',
selector=GenericSelector(set=bf.modify_accis),
value_descriptor=RangeParameter(min_val=0.1, max_val=0.9)
),
]

##

objectives = [
MeterReader("Electricity:Facility", name="Electricity Usage"),
]

evaluator = EvaluatorEP(
problem=EPProblem(
inputs=parameters_set,
outputs=objectives,
minimize_outputs=[
True
],
),
building=building,
)


results1 = NSGAII(evaluator, evaluations=1, population_size=3)
73 changes: 73 additions & 0 deletions besos_parametric_accis_functions_imported.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
from besos import eppy_funcs as ef
from besos.evaluator import EvaluatorEP
from besos.optimizer import NSGAII
from besos.parameters import RangeParameter, Parameter, GenericSelector
from besos.problem import EPProblem
from besos.objectives import VariableReader, MeterReader

import accim.sim.accis_single_idf_funcs as accis
import accim.funcs_for_besos.param_accis as bf

##

building = ef.get_building('TestModel_onlyGeometryForVRFsystem_2zones_CalcVent_V2310.idf')

accis.addAccis(
idf=building,
ScriptType='vrf_mm',
SupplyAirTempInputMethod='temperature difference',
Output_keep_existing=False,
Output_type='standard',
Output_freqs=['hourly'],
# EnergyPlus_version='9.4',
TempCtrl='temperature',
Output_gen_dataframe=True,
)

##

# def modify_accis(building, value):
# accis.modifyAccis(
# idf=building,
# ComfStand=1,
# CAT=3,
# ComfMod=3,
# # SetpointAcc=1000,
# HVACmode=2,
# VentCtrl=0,
# CoolSeasonStart='01/02',
# CoolSeasonEnd='01/03',
# VSToffset=value,
# # MinOToffset=50,
# # MaxWindSpeed=50
# )
# return

##
parameters_set = [
Parameter(
name='VSToffset',
selector=GenericSelector(set=bf.modify_VSToffset),
value_descriptor=RangeParameter(min_val=0.1, max_val=0.9)
),
]

##

objectives = [
MeterReader("Electricity:Facility", name="Electricity Usage"),
]

evaluator = EvaluatorEP(
problem=EPProblem(
inputs=parameters_set,
outputs=objectives,
minimize_outputs=[
True
],
),
building=building,
)


results1 = NSGAII(evaluator, evaluations=1, population_size=3)

0 comments on commit 65278b5

Please sign in to comment.