""" Module: write_readme.py Description: A robust local file writer script to safely generate the professional, high-impact README.md file without terminal-escaping issues. """ import os
readme_content = """# Task Scheduler Optimization System ⚙️
An enterprise-grade Operations Research (OR) platform that maps dependency-bound task networks to resource timelines. The system leverages Directed Acyclic Graphs (DAG) and benchmarks an
[CSV / API JSON Ingestion] ──> [DAG Topological Cycle Check] ──> [Dual-Engine Solvers] ──> [SQLite Log Layer] ──> [Streamlit Gantt App]
Task workflows are handled as directed dependency networks. The pre-processor monitors in-degree variables, runs linear cycle detection to catch infinite scheduling loops, and returns a safe linear sequence for resource allocation.
The greedy pipeline uses an inverted internal binary heap layout. It constantly extracts the highest-priority, tightest-deadline task, mimicking operating system thread execution architectures.
- Disjunctive Timelines:
AddNoOverlap(Intervals)ensures no two tasks execute concurrently on a single person. - Precedence Safety:
Start >= End of Parentmathematically guarantees prerequisite enforcement. - Modulo Working Windows:
Start >= S + 24kandEnd <= E + 24kforces tasks strictly inside repeating 24-hour shift calendars.
| Operational Analytics Tracked | Track A: Max-Heap Heuristic | Track B: Google CP-SAT Solver | Impact / Business Value |
|---|---|---|---|
| SLA Compliance Rate | 71.4% | 100.0% | +28.6% On-Time Increase |
| Accumulated Project Delays | 14 Hours Overdue | 0 Hours (Perfect Fit) | Eliminates Overtime Penalties |
| Mathematical Feasibility | Approximate Local Search | Globally Proven Optimum | Maximum Resource Efficiency |
Task-Scheduler-Optimization-System/
├── data/ # Operational datasets (tasks.csv, resources.csv)
├── src/ # Computational pipeline packages
│ ├── greedy.py # Kahn's sort & Max-Heap baseline engine
│ ├── cpsat_solver.py # Google OR-Tools exact constraints model
│ ├── metrics.py # SLA compilation and utilization trackers
│ └── app.py # FastAPI production router gateway
├── tests/ # Automated PyTest constraint invariant assertions
├── app_dashboard.py # Main entrypoint: Interactive Streamlit UI App
├── main.py # Main entrypoint: High-Impact Terminal CLI Dashboard
└── requirements.txt # Package lockfile (ortools, fastapi, streamlit, altair)
cd Task-Scheduler-Optimization-System
python -m venv .venv
.\\.venv\\Scripts\\activate
pip install -r requirements.txt- To view the Web Dashboard (Interactive Altair Gantt & Live KPI Analytics):
streamlit run app_dashboard.py
- To run the quick Terminal CLI Dashboard:
python main.py
- To serve the production backend API gateway:
uvicorn src.app:app --reload
- Integrated business constraints directly into strict mathematical interval and boundary formulas.
- Built a complete Python data pipeline separating validation structures (Pydantic), API serving (FastAPI), mathematical optimization (OR-Tools), and front-end rendering (Streamlit).
- Created a verifiable benchmarking engine that explicitly highlights the performance gap between greedy heuristics and advanced global searches. """
def generate_readme(): try: # Write the README.md in the current working directory with open("README.md", "w", encoding="utf-8") as f: f.write(readme_content) print("\n[SUCCESS] README.md has been generated successfully and cleanly!") except Exception as e: print(f"\n[ERROR] Could not write README.md: {str(e)}")
if name == "main": generate_readme()