laborchestrator.engine.schedule_manager module¶
The ScheduleManager oversees the scheduling and rescheduling process. It should be notified, when the current schedule gets invalid for some reason. It starts and tries to maintain a connection to a scheduler_server. From this server it requests new schedules when required. It uses the WFG class to encode and decode messages to the scheduling server.
- class laborchestrator.engine.schedule_manager.ScheduleManager(jssp: SchedulingInstance, db_client: StatusDBInterface | None = None)[source]¶
Bases:
object- _get_schedule_from_scheduler(time_limit: float, J: Dict[str, ProcessStep]) Tuple[Schedule | None, str][source]¶
Requests a schedule from the scheduler server :param time_limit: limit for the computation time :param J: dictionary of jobs to schedule :return: A schedule if the scheduler found one, else None
- _hold_rescheduling: bool¶
- property _processes_to_schedule: list[str]¶
- _reschedule(time_limit: float, try_hard: bool) None[source]¶
Handles the flags and result from a scheduling attempt :param time_limit: :param try_hard: :return:
- _rescheduling: bool¶
- _schedule_optimal: bool¶
- _schedule_valid: bool¶
- _scheduler_client: Client | None = None¶
- db_client: StatusDBInterface | None¶
- extract_near_future(n_steps: int) Dict[str, ProcessStep][source]¶
- is_connected_to_scheduler() bool[source]¶
Tests and returns whether a scheduler server is connected :return:
- jssp: SchedulingInstance¶
- mark_schedule_invalid(enforce: bool = True)[source]¶
Sets the schedule to invalid and thereby triggers a rescheduling. If AUTOMATIC_RESCHEDULING is deactivated this will not happen unless the parameter enforce is set (which for example happens after a process is started).
- schedule_quality: ScheduleQuality = 4¶
- property scheduler_client: Client | None¶
- scheduler_heart_beat()[source]¶
Frequently checks if the scheduler server is still online while the scheduler client is not None.
- time_limit_long = 5¶
- time_limit_short = 2¶