π Schedule Optimization Project is a tool designed to generate optimized work schedules for a team of agents. It considers various constraints like availability, training days, preferences, and more like multiple leave periods to create balanced schedules. The project aims to minimize scheduling conflicts while maximizing fairness and efficiency.
π It is the user's responsibility to ensure that the rules specific to their organization or sector are also respected. This project may require π οΈ adjustments for other domains or legislative frameworks.
- π Generate tailored schedules accommodating agent availability, leaves, and preferences.
- βοΈ Optimize workloads while adhering to strict and flexible constraints.
- β Hard Constraints: Rules strictly enforced (e.g., no overlapping shifts).
- π Soft Constraints: Preferences considered for optimization (e.g., preferred shifts).
- π¨ Flexible parameters defined through the
config.jsonfile. - βοΈ Support for agent preferences, exclusions, training days, and multiple leave periods.
- π Vue.js-powered frontend for seamless schedule visualization and interaction.
Ensure the following tools are installed:
- π» Python 3.10+
- π¦ Node.js and npm
- π¦ Flask
- π Git
-
π§ Clone the repository:
git clone https://github.com/Vhivi/ScheduleOptimization.git cd ScheduleOptimization -
βοΈ Configure the application:
- Create your local config from the example:
cd backend cp config.example.json config.json- Then edit
backend/config.jsonto define agents, shifts, and constraints. backend/config.jsonis intentionally local and ignored by Git.
-
π§ Setup and run the backend (recommended with a virtual environment):
cd backend python -m venv .venv .\.venv\Scripts\Activate.ps1 python -m pip install --upgrade pip pip install -r requirements.txt python -m pytest -q flask run
-
π© Launch the frontend server:
Note: The
npm installstep is mandatory only during the initial setup or when new dependencies are added. You can skip this step during subsequent launches if no changes have been made to the dependencies.cd frontend npm install npm run serveOptional API base URL override (default:
http://127.0.0.1:5000):# Windows PowerShell $env:VUE_APP_API_BASE_URL="http://127.0.0.1:5000" npm run serve
-
π Access the application at
http://localhost:8080and start scheduling!
Run tests before opening a pull request:
cd backend
.\.venv\Scripts\Activate.ps1
python -m pytest -qcd frontend
npm test -- --runInBandUse these files together:
- Reference guide:
docs/config-reference.md - JSON schema:
backend/config.schema.json - Ready-to-copy example:
backend/config.example.json
Before running the backend, create your local runtime file:
cd backend
cp config.example.json config.jsonbackend/config.json is local-only and ignored by Git.
Important date formats:
- Full dates:
dd-mm-YYYY - Recurring holidays:
dd-mm
Core sections in config.json:
agents: people and individual constraints (preferences, unavailable dates, training, exclusions, leave periods)vacations: generated shift types (Jour,Nuit,CDP)vacation_durations: paid-hour durations for each shift plusCongeholidays: recurring public holidayssolver: optional runtime and fairness tuning
- Powered by Flask and Google OR-Tools.
- Modular structure for adding constraints via the
generate_planningfunction.
- Built with Vue.js for a dynamic user experience.
- Includes filters, customization options, and hot reloading for rapid development.
- βοΈ Modify the
generate_planningfunction inapp.py. - π§ Check that your constraint is well integrated and produces the desired effects.
- βοΈ Update documentation and configuration as needed.
- Keep dependency updates incremental and low risk by default (minor and patch versions first).
- Run backend and frontend tests for each dependency update batch.
- Use
npm audit fixwithout--forcein regular maintenance batches. - Handle breaking updates (for example major Jest/jsdom upgrades) in dedicated pull requests.
- Keep
CHANGELOG.mdupdated underUnreleasedfor each maintenance batch.
π As this is a personal project tailored to meet my current needs, no formal roadmap is planned. However, one potential improvement could be the standardization of language throughout the code and comments.
Contributions are welcome! This project thrives on feedback and community input.
Before contributing, please take a look at our ARCHITECTURE.md file to understand the project's architecture and design decisions.
Hereβs how you can contribute:
-
Fork the Repository: Create a copy of the project under your GitHub account.
-
Make Your Changes: Work on the improvements youβd like to add. Be sure to follow the projectβs coding style and guidelines.
-
Submit a Pull Request: Propose your changes by creating a pull request. Provide a clear description of your updates and the problem they solve.
- Bug Fixes: Identify and resolve issues in the existing code.
- Feature Enhancements: Add new functionalities or optimize existing ones.
- Documentation Improvements: Enhance clarity, fix errors, or update outdated content.
- Code Standardization: Help in uniformizing the language and comments in the codebase.
Contributions of all kinds are appreciated, and weβre here to support you throughout the process!
This project is licensed under the MIT License. See the LICENSE file for details.
Special thanks to the following:
- Google OR-Tools
- Vue.js
- Flask
- Mermaid for diagramming support in Architecture.md
The open-source community for inspiration and examples:
And you, for exploring or/and contributing to this project!
Enjoy scheduling smarter with the Schedule Optimization Project! β¨