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

refactor update optimization config

parent 2f790134
Branches
No related tags found
No related merge requests found
......@@ -33,6 +33,12 @@
"CRITERIA": {
"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_X": "",
"PLOT_Y": "",
......
......@@ -5,10 +5,6 @@ import json
import os
from optimize_main import run_optimization
import json
import os
from optimize_main import run_optimization
class MOO4ModelicaWrapper:
def __init__(self, orchestration_config_path, config_path):
self.orchestration_config_path = orchestration_config_path
......@@ -33,6 +29,8 @@ class MOO4ModelicaWrapper:
self.config['OBJECTIVES'] = self.orchestration_config['OBJECTIVES']
self.config['PLOT_CONFIG'] = self.orchestration_config['PLOT_CONFIG']
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:
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