diff --git a/wombat/core/service_equipment.py b/wombat/core/service_equipment.py index 32cd49ea..a662869d 100644 --- a/wombat/core/service_equipment.py +++ b/wombat/core/service_equipment.py @@ -403,6 +403,12 @@ def get_next_request(self): simpy.resources.store.FilterStoreGet The next ``RepairRequest`` to be processed. """ + # Avoid requests for the same system and therefore a timing collision + seconds_to_wait, *_ = ( + self.env.random_generator.integers(low=0, high=10, size=1) / 3600.0 + ) + yield self.env.timeout(seconds_to_wait) + if self.settings.method == "turbine": return self.manager.get_request_by_system(self.settings.capability) if self.settings.method == "severity": @@ -1647,12 +1653,6 @@ def run_scheduled_in_situ(self) -> Generator[Process, None, None]: ) ) - # Avoid requests for the same system and therefore a timing collision - seconds_to_wait, *_ = ( - self.env.random_generator.integers(low=0, high=10, size=1) / 3600.0 - ) - yield self.env.timeout(seconds_to_wait) - request = self.get_next_request() if request is None: if not self.at_port: @@ -1745,12 +1745,6 @@ def run_unscheduled_in_situ(self) -> Generator[Process, None, None]: return while True and self.env.now < charter_end_env_time: - # Avoid requests for the same system and therefore a timing collision - seconds_to_wait, *_ = ( - self.env.random_generator.integers(low=0, high=10, size=1) / 3600.0 - ) - yield self.env.timeout(seconds_to_wait) - request = self.get_next_request() if request is None: yield self.env.process( @@ -1835,12 +1829,6 @@ def run_unscheduled_in_situ(self) -> Generator[Process, None, None]: ) ) - # Avoid requests for the same system and therefore a timing collision - seconds_to_wait, *_ = ( - self.env.random_generator.integers(low=0, high=10, size=1) / 3600.0 - ) - yield self.env.timeout(seconds_to_wait) - request = self.get_next_request() if request is None: yield self.env.process(