File size: 3,048 Bytes
7d8d330
 
 
 
 
 
 
51b84b9
7d8d330
 
 
 
 
51b84b9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
---
title: Supply Roster Optimization
emoji: πŸ“Š
colorFrom: blue
colorTo: green
sdk: streamlit
sdk_version: "1.28.0"
app_file: ui/app.py
pinned: false
---

# Supply Roster Optimization

A comprehensive Streamlit application for optimizing supply roster management using OR-Tools with improved code organization and readability.

## πŸš€ Quick Start

### Option 1: Using Main Entry Point (Recommended)
```bash
python main.py
```

### Option 2: Direct Streamlit Command
```bash
streamlit run ui/app.py
```

## πŸ“ Project Structure

```
SD_roster_real/
β”œβ”€β”€ main.py                          # Main entry point
β”œβ”€β”€ README.md
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ setup.py
β”‚
β”œβ”€β”€ src/                             # Core business logic
β”‚   β”œβ”€β”€ config/                      # Configuration management
β”‚   β”‚   β”œβ”€β”€ constants.py
β”‚   β”‚   β”œβ”€β”€ optimization_config.py
β”‚   β”‚   └── paths.yaml
β”‚   β”œβ”€β”€ models/                      # Optimization models
β”‚   β”‚   └── optimizer_real.py
β”‚   β”œβ”€β”€ preprocess/                  # Data preprocessing
β”‚   β”‚   β”œβ”€β”€ data_preprocess.py
β”‚   β”‚   β”œβ”€β”€ extract.py
β”‚   β”‚   β”œβ”€β”€ transform.py
β”‚   β”‚   └── ...
β”‚   └── visualization/               # Chart generation
β”‚       β”œβ”€β”€ hierarchy_dashboard.py
β”‚       └── kit_relationships.py
β”‚
β”œβ”€β”€ ui/                              # Streamlit UI components
β”‚   β”œβ”€β”€ app.py                       # Main Streamlit app
β”‚   β”œβ”€β”€ pages/                       # Page components
β”‚   β”‚   β”œβ”€β”€ config_page.py           # Settings page
β”‚   β”‚   β”œβ”€β”€ optimization_results.py  # Results page
β”‚   β”‚   └── __init__.py
β”‚   β”œβ”€β”€ components/                  # Reusable UI components
β”‚   β”‚   └── __init__.py
β”‚   └── __init__.py
β”‚
β”œβ”€β”€ data/                            # Data files
β”œβ”€β”€ notebook/                        # Jupyter notebooks
└── venv/                           # Virtual environment
```

## πŸ”§ Features

- **Multi-page Interface**: Clean separation of settings, results, and validation
- **Real-time Optimization**: OR-Tools powered workforce scheduling
- **Data Validation**: Comprehensive demand data validation and visualization
- **Cost Analysis**: Detailed cost breakdown and analysis
- **Hierarchy Management**: Kit dependency tracking and visualization
- **Flexible Configuration**: Extensive parameter customization

## πŸ“Š Usage

1. **Settings Page**: Configure optimization parameters, workforce limits, and cost rates
2. **Optimization Results**: View detailed results with charts and analysis
3. **Demand Validation**: Validate input data and identify potential issues

## πŸ› οΈ Development

The project follows a clean architecture with:
- **Separation of Concerns**: UI logic separated from business logic
- **Modular Design**: Reusable components and clear interfaces
- **Git-friendly**: Proper file organization with preserved Git history