Skip to content
Snippets Groups Projects
Commit 923b9028 authored by Zizhe Wang's avatar Zizhe Wang
Browse files

refactor update optimization config

parent 2f790134
No related branches found
No related tags found
No related merge requests found
...@@ -33,6 +33,12 @@ ...@@ -33,6 +33,12 @@
"CRITERIA": { "CRITERIA": {
"GOAL_EXPRESSION": "evaluation_results['performance'] >= simulation_inputs['user_demand']" "GOAL_EXPRESSION": "evaluation_results['performance'] >= simulation_inputs['user_demand']"
}, },
"OPTIMIZATION_CONFIG": {
"USE_SINGLE_OBJECTIVE": false,
"ALGORITHM_NAME": "nsga2",
"POP_SIZE": 5,
"N_GEN": 2
},
"PLOT_CONFIG": { "PLOT_CONFIG": {
"PLOT_X": "", "PLOT_X": "",
"PLOT_Y": "", "PLOT_Y": "",
......
...@@ -5,10 +5,6 @@ import json ...@@ -5,10 +5,6 @@ import json
import os import os
from optimize_main import run_optimization from optimize_main import run_optimization
import json
import os
from optimize_main import run_optimization
class MOO4ModelicaWrapper: class MOO4ModelicaWrapper:
def __init__(self, orchestration_config_path, config_path): def __init__(self, orchestration_config_path, config_path):
self.orchestration_config_path = orchestration_config_path self.orchestration_config_path = orchestration_config_path
...@@ -33,6 +29,8 @@ class MOO4ModelicaWrapper: ...@@ -33,6 +29,8 @@ class MOO4ModelicaWrapper:
self.config['OBJECTIVES'] = self.orchestration_config['OBJECTIVES'] self.config['OBJECTIVES'] = self.orchestration_config['OBJECTIVES']
self.config['PLOT_CONFIG'] = self.orchestration_config['PLOT_CONFIG'] self.config['PLOT_CONFIG'] = self.orchestration_config['PLOT_CONFIG']
self.config['N_JOBS'] = self.orchestration_config['N_JOBS'] self.config['N_JOBS'] = self.orchestration_config['N_JOBS']
for key, value in self.orchestration_config['OPTIMIZATION_CONFIG'].items():
self.config['OPTIMIZATION_CONFIG'][key] = value
with open(self.config_path, 'w') as f: with open(self.config_path, 'w') as f:
json.dump(self.config, f, indent=4) json.dump(self.config, f, indent=4)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment