# weiran-aitech/shift_schedule architecture

> Architecture diagram of the GitHub repository weiran-aitech/shift_schedule, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/weiran-aitech/shift_schedule
- Repository: https://github.com/weiran-aitech/shift_schedule

## Overview

##### Key Interactions to Highlight

a. Data Flow
- User Input → Constraint Processing
- Constraint Processing → Optimization Engine
- Optimization Engine → Schedule Generation
- Schedule Generation → Visualization Components

b. Integration Points
- External Data Import/Export
- Excel Integration
- Communication Systems (text/social media)

##### Special Architectural Elements

a. Constraint Management System
- Basic Constraints Repository
- Complex Constraints Builder
- Dynamic Constraint Adjuster

b. Optimization Components
- AI Processing Unit
- Combinatorial Optimization Engine
- Schedule Adjustment Handler

##### Additional Elements

- Configuration Management
- Schedule Validation
- Output Formatting
- Error Handling

##### The integration capabilities with external systems

This design should reflect the software's ability to handle complex scheduling problems while maintaining user-friendly interaction through its GUI and dialog-based constraint input system.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#f1c40f,stroke:#f39c12,color:black
    classDef critical fill:#e74c3c,stroke:#c0392b,color:white
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white

    %% User Interface Layer
    subgraph UI
        GUI[GUI Component]
        InputForms[Input Forms/Dialog Boxes]
        GanttChart[Gantt Chart Visualization]
        ScheduleTables[Schedule Tables Display]
    end

    %% Core Engine Layer
    subgraph Engine
        SchedEngine[Scheduling Engine]
        ConstraintProc[Constraint Processing Module]
        OptAlgo[Optimization Algorithms]
        SchedGen[Schedule Generation Module]
    end

    %% Data Management Layer
    subgraph Data
        EmpData[Employee Data Manager]
        SchedData[Schedule Data Store]
        Prefs[Preferences Handler]
        Template[Template Manager]
    end

    %% Constraint Management System
    subgraph Constraints
        BasicConst[Basic Constraints Repository]
        ComplexConst[Complex Constraints Builder]
        DynamicConst[Dynamic Constraint Adjuster]
    end

    %% Optimization Components
    subgraph Optimization
        AIProc[AI Processing Unit]
        CombiOpt[Combinatorial Optimization Engine]
        SchedAdj[Schedule Adjustment Handler]
    end

    %% Additional Components
    Config[Configuration Management]
    Validation[Schedule Validation]
    OutputFormat[Output Formatting]
    ErrorHandle[Error Handling]
    MinShiftReq[Minimum Shift Requirements]

    %% Relationships
    GUI --> InputForms
    InputForms --> ConstraintProc
    ConstraintProc --> OptAlgo
    OptAlgo --> SchedGen
    SchedGen --> GanttChart
    SchedGen --> ScheduleTables
    
    EmpData --> SchedEngine
    Prefs --> SchedEngine
    Template --> SchedEngine
    
    BasicConst --> ConstraintProc
    ComplexConst --> ConstraintProc
    DynamicConst --> ConstraintProc
    
    AIProc --> CombiOpt
    CombiOpt --> SchedAdj
    SchedAdj --> SchedGen
    
    MinShiftReq --> SchedEngine
    
    %% Click Events
    click GUI "https://github.com/weiran-aitech/shift_schedule/blob/main/Code/GUI_BG_Image.py"
    click SchedEngine "https://github.com/weiran-aitech/shift_schedule/blob/main/Code/StaffShiftScheduling.py"
    click Prefs "https://github.com/weiran-aitech/shift_schedule/blob/main/Code/Preferences.py"
    click Template "https://github.com/weiran-aitech/shift_schedule/blob/main/Code/EmployeeDataTemplate.csv"
    click MinShiftReq "https://github.com/weiran-aitech/shift_schedule/blob/main/Examples/Airport Personnel Scheduling/minShiftReqStaffs.py"

    %% Style Applications
    class GUI,InputForms,GanttChart,ScheduleTables ui
    class SchedEngine,ConstraintProc,OptAlgo,SchedGen core
    class EmpData,SchedData,Prefs,Template data
    class Config,Validation,OutputFormat,ErrorHandle external
    class AIProc,CombiOpt,SchedAdj critical
```
