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
_manage_rescheduling()[source]
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
configure_lab(yaml_file: str) bool[source]
continue_rescheduling()[source]
db_client: StatusDBInterface | None
extract_near_future(n_steps: int) Dict[str, ProcessStep][source]
hold_rescheduling()[source]
is_connected_to_scheduler() bool[source]

Tests and returns whether a scheduler server is connected :return:

is_rescheduling()[source]
jssp: SchedulingInstance
keep_horizon()[source]
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).

mark_schedule_suboptimal()[source]
schedule_executable() bool[source]
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
try_scheduler_connection(timeout=5)[source]

Tries to find a scheduler in the network and establishes connection in both directions :return:

class laborchestrator.engine.schedule_manager.ScheduleQuality(*values)[source]

Bases: Enum

FEASIBLE = 1
INFEASIBLE = 2
NOT_FOUND = 3
OPTIMAL = 0
UNKNOWN = 4