From 778a2daf795e0d15b2e036dd8ddefb861374c17b Mon Sep 17 00:00:00 2001 From: Andreas Bolin <2535580+andbo467@users.noreply.github.com> Date: Sat, 30 Jul 2022 00:06:26 +0200 Subject: [PATCH] Made Schedule.get_max_end_time() public. --- b_asic/schedule.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/b_asic/schedule.py b/b_asic/schedule.py index eb3528a7..83f3fb49 100644 --- a/b_asic/schedule.py +++ b/b_asic/schedule.py @@ -41,7 +41,7 @@ class Schedule: raise NotImplementedError( f"No algorithm with name: {scheduling_alg} defined.") - max_end_time = self._get_max_end_time() + max_end_time = self.get_max_end_time() if schedule_time is None: self._schedule_time = max_end_time @@ -56,7 +56,8 @@ class Schedule: assert op_id in self._start_times, "No operation with the specified op_id in this schedule." return self._start_times[op_id] - def _get_max_end_time(self) -> int: + def get_max_end_time(self) -> int: + """Returnes the current maximum end time among all operations.""" max_end_time = 0 for op_id, op_start_time in self._start_times.items(): op = self._sfg.find_by_id(op_id) @@ -126,7 +127,7 @@ class Schedule: raise NotImplementedError def set_schedule_time(self, time: int) -> "Schedule": - assert self._get_max_end_time() <= time, "New schedule time to short." + assert self.get_max_end_time() <= time, "New schedule time to short." self._schedule_time = time return self -- GitLab