Skip to content

Commit

Permalink
Bugfix: set_pump_speed
Browse files Browse the repository at this point in the history
  • Loading branch information
andreArtelt committed Dec 31, 2024
1 parent 2eea39d commit 7bedb01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion epyt_flow/gym/scenario_control_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def set_pump_speed(self, pump_id: str, speed: float) -> None:
if pattern_idx == 0:
warnings.warn(f"No pattern for pump '{pump_id}' found -- a new pattern is created")
pattern_idx = self._scenario_sim.epanet_api.addPattern(f"pump_speed_{pump_id}")
self._scenario_sim.epanet_api.setLinkPumpPatternIndex(pump_idx, pattern_idx)
self._scenario_sim.epanet_api.setLinkPumpPatternIndex(pump_idx + 1, pattern_idx)

self._scenario_sim.epanet_api.setPattern(pattern_idx, np.array([speed]))

Expand Down

0 comments on commit 7bedb01

Please sign in to comment.