Skip to content

Commit d8cc936

Browse files
authored
feat: add calibration result collection
1 parent 27d36f0 commit d8cc936

File tree

8 files changed

+816
-502
lines changed

8 files changed

+816
-502
lines changed

config/experiments/experiment_2.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# OpenDT Experiment Configuration
22

33
global:
4-
speed_factor: 200 # 1.0 = Realtime, -1 = Max Speed
4+
speed_factor: 300 # 1.0 = Realtime, -1 = Max Speed
55
calibration_enabled: true
66

77
services:
@@ -10,15 +10,14 @@ services:
1010
heartbeat_frequency_minutes: 1
1111

1212
simulator:
13-
simulation_frequency_minutes: 15
13+
simulation_frequency_minutes: 60
1414

1515
calibrator:
16-
calibration_frequency_minutes: 60
1716
calibrated_property: "cpuPowerModel.calibrationFactor"
18-
min_value: 1
19-
max_value: 20
20-
linspace_points: 6
21-
max_parallel_workers: 3
17+
min_value: 3
18+
max_value: 9
19+
linspace_points: 10
20+
max_parallel_workers: 4
2221
mape_window_minutes: 1440
2322

2423
kafka:

libs/common/odt_common/config.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ class SimulatorConfig(BaseModel):
7171
class CalibratorConfig(BaseModel):
7272
"""Calibrator service configuration."""
7373

74-
calibration_frequency_minutes: int = Field(
75-
default=30, description="Calibration frequency in simulation minutes", gt=0
76-
)
7774
calibrated_property: str = Field(
7875
default="cpuPowerModel.asymUtil",
7976
description="Dot-notation path to topology property to calibrate",

services/calibrator/calibrator/calibration_engine.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,9 @@ def run_calibration_sweep(
176176
Returns:
177177
List of CalibrationResult objects
178178
"""
179-
# Generate parameter values to test
179+
# Generate parameter values to test (rounded to 2 decimal places)
180180
param_values = np.linspace(min_value, max_value, num_points)
181+
param_values = np.round(param_values, 2)
181182

182183
logger.info(
183184
f"Starting calibration sweep for {property_path}: "
@@ -187,11 +188,12 @@ def run_calibration_sweep(
187188
# Create topology variants
188189
topologies = []
189190
for i, value in enumerate(param_values):
190-
topology_variant = topology_modifier_func(property_path, float(value))
191+
rounded_value = round(float(value), 2)
192+
topology_variant = topology_modifier_func(property_path, rounded_value)
191193
if topology_variant is None:
192-
logger.error(f"Failed to create topology variant for value {value}")
194+
logger.error(f"Failed to create topology variant for value {rounded_value}")
193195
continue
194-
topologies.append((i, float(value), topology_variant))
196+
topologies.append((i, rounded_value, topology_variant))
195197

196198
if not topologies:
197199
logger.error("No topology variants created, aborting calibration")

0 commit comments

Comments
 (0)