Skip to content

Commit

Permalink
0.7.5 - optimisation and parametric simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
dsanchez-garcia committed Jun 5, 2024
1 parent b017bf9 commit 5c7ca81
Show file tree
Hide file tree
Showing 7 changed files with 327 additions and 106 deletions.
Binary file modified WIP_outputs_optimisation_custom.xlsx
Binary file not shown.
381 changes: 299 additions & 82 deletions accim/parametric_and_optimisation/main.py

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions optimisation_simulation_usage_v00_accim_custom_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@
df_outputmeters_2, df_outputvariables_2 = test_class_instance.get_outputs_df_from_testsim()

#Other variables could be reported. These can be read in the rdd, mdd and mtd files
df_rdd = test_class_instance.get_rdd_file_as_df()
df_mdd = test_class_instance.get_mdd_file_as_df()
meter_list = test_class_instance.parse_mtd_file()
df_rdd = get_rdd_file_as_df()
df_mdd = get_mdd_file_as_df()
meter_list = parse_mtd_file()


# To end with outputs, let's set the objective outputs (outputs for the Problem object), which are those displayed by BESOS in case of parametric_and_optimisation analysis, or used in case of optimisation
Expand All @@ -105,7 +105,7 @@ def return_time_series(result):
df_outputvariables_3 = df_outputvariables_3.drop(index=[2, 4])
df_outputvariables_3['name'] = df_outputvariables_3['variable_name'] + '_time series'

test_class_instance.set_outputs_for_parametric_simulation(
test_class_instance.set_outputs_for_simulation(
df_output_meter=df_outputmeters_2,
df_output_variable=df_outputvariables_3,
)
Expand Down Expand Up @@ -155,7 +155,7 @@ def return_time_series(result):
[i for i in building.idfobjects['EnergyManagementSystem:Program'] if i.Name.lower() == 'applycat']


[i.name for i in test_class_instance.param_sim_outputs]
[i.name for i in test_class_instance.sim_outputs]

# Let's set the problem
test_class_instance.set_problem(
Expand Down
15 changes: 8 additions & 7 deletions optimisation_simulation_usage_v00_accim_custom_works.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import accim.parametric_and_optimisation.funcs_for_besos.param_accis as bf

import accim.parametric_and_optimisation.parameters as params
from accim.parametric_and_optimisation.main import OptimParamSimulation
from accim.parametric_and_optimisation.main import OptimParamSimulation, get_mdd_file_as_df, get_rdd_file_as_df, parse_mtd_file

# 1. check output data
# 2. check input dataframe
Expand Down Expand Up @@ -83,9 +83,9 @@
df_outputmeters_2, df_outputvariables_2 = test_class_instance.get_outputs_df_from_testsim()

#Other variables could be reported. These can be read in the rdd, mdd and mtd files
df_rdd = test_class_instance.get_rdd_file_as_df()
df_mdd = test_class_instance.get_mdd_file_as_df()
meter_list = test_class_instance.parse_mtd_file()
df_rdd = get_rdd_file_as_df()
df_mdd = get_mdd_file_as_df()
meter_list = parse_mtd_file()


# To end with outputs, let's set the objective outputs (outputs for the Problem object), which are those displayed by BESOS in case of parametric_and_optimisation analysis, or used in case of optimisation
Expand All @@ -105,7 +105,7 @@
# df_outputvariables_3 = df_outputvariables_3.drop(index=[2, 4])
# df_outputvariables_3['name'] = df_outputvariables_3['variable_name'] + '_time series'

test_class_instance.set_outputs_for_parametric_simulation(
test_class_instance.set_outputs_for_simulation(
df_output_meter=df_outputmeters_2,
# df_output_variable=df_outputvariables_3,
)
Expand Down Expand Up @@ -183,10 +183,11 @@
# )

outputs = test_class_instance.run_optimisation(
algorithm='NSGAII',
epw='Sydney.epw',
out_dir='WIP_testing optimisation',
evaluations=5,
population_size=10
evaluations=2,
population_size=4
)


Expand Down
8 changes: 4 additions & 4 deletions parametric_simulation_usage_v00_accim_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@
df_outputmeters_2, df_outputvariables_2 = test_class_instance.get_outputs_df_from_testsim()

#Other variables could be reported. These can be read in the rdd, mdd and mtd files
df_rdd = test_class_instance.get_rdd_file_as_df()
df_mdd = test_class_instance.get_mdd_file_as_df()
meter_list = test_class_instance.parse_mtd_file()
df_rdd = get_rdd_file_as_df()
df_mdd = get_mdd_file_as_df()
meter_list = parse_mtd_file()


# To end with outputs, let's set the objective outputs (outputs for the Problem object), which are those displayed by BESOS in case of parametric_and_optimisation analysis, or used in case of optimisation
Expand All @@ -105,7 +105,7 @@ def return_time_series(result):
df_outputvariables_3 = df_outputvariables_3.drop(index=[2, 4])
df_outputvariables_3['name'] = df_outputvariables_3['variable_name'] + '_time series'

test_class_instance.set_outputs_for_parametric_simulation(
test_class_instance.set_outputs_for_simulation(
df_output_meter=df_outputmeters_3,
# df_output_variable=df_outputvariables_3,
df_output_variable=df_outputvariables_3,
Expand Down
11 changes: 7 additions & 4 deletions parametric_simulation_usage_v00_accim_predef.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@

accim.utils.set_occupancy_to_always(idf_object=building)

new_test = OptimParamSimulation()

test_class_instance = OptimParamSimulation(
building=building,
parameters_type='accim predefined model'
Expand Down Expand Up @@ -83,9 +85,9 @@
df_outputmeters_2, df_outputvariables_2 = test_class_instance.get_outputs_df_from_testsim()

#Other variables could be reported. These can be read in the rdd, mdd and mtd files
df_rdd = test_class_instance.get_rdd_file_as_df()
df_mdd = test_class_instance.get_mdd_file_as_df()
meter_list = test_class_instance.parse_mtd_file()
df_rdd = get_rdd_file_as_df()
df_mdd = get_mdd_file_as_df()
meter_list = parse_mtd_file()


# To end with outputs, let's set the objective outputs (outputs for the Problem object), which are those displayed by BESOS in case of parametric_and_optimisation analysis, or used in case of optimisation
Expand All @@ -105,7 +107,7 @@ def return_time_series(result):
df_outputvariables_3 = df_outputvariables_3.drop(index=[2, 4])
df_outputvariables_3['name'] = df_outputvariables_3['variable_name'] + '_time series'

test_class_instance.set_outputs_for_parametric_simulation(
test_class_instance.set_outputs_for_simulation(
df_output_meter=df_outputmeters_3,
# df_output_variable=df_outputvariables_3,
df_output_variable=df_outputvariables_3,
Expand Down Expand Up @@ -245,4 +247,5 @@ def return_time_series(result):



##

8 changes: 4 additions & 4 deletions parametric_simulation_usage_v00_apmv.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@
df_outputmeters_2, df_outputvariables_2 = test_class_instance.get_outputs_df_from_testsim()

#Other variables could be reported. These can be read in the rdd, mdd and mtd files
df_rdd = test_class_instance.get_rdd_file_as_df()
df_mdd = test_class_instance.get_mdd_file_as_df()
meter_list = test_class_instance.parse_mtd_file()
df_rdd = get_rdd_file_as_df()
df_mdd = get_mdd_file_as_df()
meter_list = parse_mtd_file()


# To end with outputs, let's set the objective outputs (outputs for the Problem object), which are those displayed by BESOS in case of parametric_and_optimisation analysis, or used in case of optimisation
Expand All @@ -106,7 +106,7 @@
# df_outputvariables_3 = df_outputvariables_3.drop(index=[2, 4])
df_outputvariables_3['name'] = df_outputvariables_3['variable_name'] + '_time series'

test_class_instance.set_outputs_for_parametric_simulation(
test_class_instance.set_outputs_for_simulation(
df_output_meter=df_outputmeters_2,
# df_output_variable=df_outputvariables_3,
df_output_variable=df_outputvariables_3,
Expand Down

0 comments on commit 5c7ca81

Please sign in to comment.