File size: 1,195 Bytes
2004c79
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
"""
Timetable constraint solver module.

This module contains the domain models, constraints, and solver logic
for employee scheduling optimization.
"""

try:
    from .domain import (
        Employee,
        Task,
        EmployeeSchedule,
        ScheduleInfo,
    )
    from .solver import solver_manager, solution_manager
    from .constraints import (
        get_slot_overlap,
        get_slot_date,
        tasks_violate_sequence_order,
        define_constraints,
    )

    _TIMEFOLD_AVAILABLE = True
except ImportError as e:
    # Handle missing timefold dependency gracefully
    _TIMEFOLD_AVAILABLE = False
    Employee = None
    Task = None
    EmployeeSchedule = None
    ScheduleInfo = None
    solver_manager = None
    solution_manager = None
    get_slot_overlap = None
    get_slot_date = None
    tasks_violate_sequence_order = None
    define_constraints = None

__all__ = [
    # Domain models
    "Employee",
    "Task",
    "EmployeeSchedule",
    "ScheduleInfo",
    # Solver managers
    "solver_manager",
    "solution_manager",
    # Constraint functions
    "get_slot_overlap",
    "get_slot_date",
    "tasks_violate_sequence_order",
    "define_constraints",
]