Keep pump units off until explicitly enabled

This commit is contained in:
Codex Agent
2025-11-22 22:48:04 +01:00
parent bcd1eec84f
commit faac1dc7b0
2 changed files with 6 additions and 4 deletions

View File

@@ -97,6 +97,8 @@ class Reactor:
self.meltdown = False
self.primary_pump_active = False
self.secondary_pump_active = False
self.primary_pump_units = [False] * len(self.primary_pump_units)
self.secondary_pump_units = [False] * len(self.secondary_pump_units)
self.turbine_unit_active = [False] * len(self.turbines)
self.turbine_active = any(self.turbine_unit_active)
if self.consumer:
@@ -481,8 +483,6 @@ class Reactor:
LOGGER.info("Primary pump %s", "enabled" if active else "stopped")
if not active:
self.primary_pump_units = [False] * len(self.primary_pump_units)
elif active and not any(self.primary_pump_units):
self.primary_pump_units = [True] * len(self.primary_pump_units)
def _set_secondary_pump(self, active: bool) -> None:
if self.secondary_pump_active != active:
@@ -490,8 +490,6 @@ class Reactor:
LOGGER.info("Secondary pump %s", "enabled" if active else "stopped")
if not active:
self.secondary_pump_units = [False] * len(self.secondary_pump_units)
elif active and not any(self.secondary_pump_units):
self.secondary_pump_units = [True] * len(self.secondary_pump_units)
def _toggle_primary_pump_unit(self, index: int, active: bool) -> None:
if index < 0 or index >= len(self.primary_pump_units):

View File

@@ -162,6 +162,8 @@ def test_full_rod_withdrawal_reaches_gigawatt_power():
reactor.control.rod_fraction = 0.0
reactor.primary_pump_active = True
reactor.secondary_pump_active = True
reactor.primary_pump_units = [True, True]
reactor.secondary_pump_units = [True, True]
early_power = 0.0
for step in range(60):
@@ -180,6 +182,8 @@ def test_partially_inserted_rods_hold_near_three_gw():
reactor.control.rod_fraction = 0.4
reactor.primary_pump_active = True
reactor.secondary_pump_active = True
reactor.primary_pump_units = [True, True]
reactor.secondary_pump_units = [True, True]
for _ in range(120):
reactor.step(state, dt=1.0)