Job Shop Scheduling Algorithms
This project implements various algorithms for solving the Job Shop Scheduling Problem (JSSP), including Q-Learning and Actor-Critic methods. It provides both a C++ library and Python bindings for easy integration into different environments.
Features
- Job Shop Environment simulation
- Q-Learning algorithm implementation
- Actor-Critic algorithm implementation
- Taillard problem instance generator
- Visualization of scheduling results
- Python bindings for easy integration
Implemented Algorithms
| Algorithm | Implemented | Notes |
|---|---|---|
| Q-Learning | ✅ | |
| SARSA | ❌ | |
| DQN (Deep Q-Network) | ❌ | |
| Double DQN | ❌ | |
| Dueling DQN | ❌ | |
| Actor-Critic | ✅ | |
| A2C (Advantage Actor-Critic) | ❌ | |
| A3C (Asynchronous Advantage Actor-Critic) | ❌ | |
| PPO (Proximal Policy Optimization) | ❌ | |
| TRPO (Trust Region Policy Optimization) | ❌ | |
| SAC (Soft Actor-Critic) | ❌ | |
| DDPG (Deep Deterministic Policy Gradient) | ❌ | |
| TD3 (Twin Delayed DDPG) | ❌ | |
| MADDPG (Multi-Agent DDPG) | ❌ | |
| QMIX (Q-Mixing) | ❌ | |
| VDN (Value Decomposition Networks) | ❌ | |
| Genetic Algorithms | ❌ | |
| Particle Swarm Optimization | ❌ | |
| Simulated Annealing | ❌ | |
| Ant Colony Optimization | ❌ |
Implemented Simulator Features
| Feature | Implemented | Notes |
|---|---|---|
| Jobs | ✅ | |
| Operations | ✅ | |
| Actions | ✅ | |
| Bindings | ✅ | |
| Taillard | ✅ | |
| Manual Environment Creator | ❌ | |
| Tool Changing | ❌ | |
| Tool Properties | ❌ | |
| Machine Breakdowns | ❌ | |
| Job Priority | ❌ | |
| Setup Times | ❌ | |
| Due Dates | ❌ |
Dependencies
This project uses vcpkg to manage C++ dependencies. The dependencies are specified in the vcpkg.json manifest file in the root directory of the project.
Before building the project, ensure you have the following installed:
Build Tools
sudo apt-get install build-essential pkg-config cmake git curl zip unzip tar autoconf autoconf-archive libtool
GLEW
sudo apt-get install libxmu-dev libxi-dev libgl-dev libglu1-mesa-dev
GLFW3
sudo apt-get install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev
Python3
sudo apt-get install python3 python3-dev
Performance Tools (for WSL2)
sudo apt-get install linux-tools-common linux-tools-generic
sudo /usr/lib/linux-tools-6.8.0-36/perf
vcpkg Setup
To install vcpkg:
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
Set the VCPKG_ROOT environment variable to the vcpkg installation directory:
export VCPKG_ROOT=/path/to/vcpkg
Building the Project
This project uses CMakePresets.json to manage build configurations. There are two main configurations: debug and release.
-
Clone the repository:
git clone https://github.com/cair/job-shop-simulator.git cd job-shop-simulator
-
To configure and build the project in debug mode:
cmake --preset=debug cmake --build --preset=debug
-
To configure and build the project in release mode:
cmake --preset=release cmake --build --preset=release
Installing the Python Package
To install the Python package, first ensure that the VCPKG_ROOT environment variable is set, then run:
pip install .
This will automatically use CMakePresets.json to build the project and install the Python package.
Usage
C++ Library
To use the C++ library in your project, include the necessary headers and link against the library:
#include <jobshop/job_shop_environment.h>
#include <jobshop/job_shop_qlearning.h>
// Your code here
Python Module
After installing the Python package, you can use it in your Python code:
import jobshop
# Create a job shop environment
env = jobshop.JobShopEnvironment(jobs)
# Create a Q-Learning agent
agent = jobshop.JobShopQLearning(env, alpha=0.1, gamma=0.9, epsilon=0.3)
# Train the agent
agent.train(num_episodes=1000)
# Print the best schedule
agent.printBestSchedule()
Project Structure
src/: Contains the C++ source filesinclude/: Contains the header filesbindings/: Contains the Python bindingsCMakeLists.txt: The main CMake configuration fileCMakePresets.json: Defines the build presetsvcpkg.json: Specifies the project dependencies for vcpkg
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Contact
If you have any questions or feedback, please open an issue on the GitHub repository.
Metadata
Release files for jobshop 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jobshop-0.1.0-cp313-cp313-manylinux_2_28_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.28+ x86-64 | Details for jobshop-0.1.0-cp313-cp313-manylinux_2_28_x86_64.whl |
| jobshop-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.28+ x86-64 | Details for jobshop-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl |
| jobshop-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.28+ x86-64 | Details for jobshop-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl |
Total release size: 12.1 MB
Release files / jobshop-0.1.0-cp313-cp313-manylinux_2_28_x86_64.whl
| Download URL | jobshop-0.1.0-cp313-cp313-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
e649323136819c28b061c62369b111fa765fe8cf02d43a9cc7c29c0aeea7df46
|
|
BLAKE2b-256 checksum How to use checksums |
286a55bc101ea3ac1a8cf404135b5c9144af1210724819fb94b56df896aa73d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / jobshop-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl
| Download URL | jobshop-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
250b4d4ac8743fb9a85ade9146c07c1b07c3ccf8428e1db4910b31df6e9286da
|
|
BLAKE2b-256 checksum How to use checksums |
66d92971eedb2822198a8310f4b753fd1894dce39e7a852889a2a696b4a8932a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / jobshop-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl
| Download URL | jobshop-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 4.0 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
ca5cf79f160b4aa6717be56a96aa033068e6f131360d084f5605469eb20c5b3d
|
|
BLAKE2b-256 checksum How to use checksums |
4d714185eefc3e5a9fe2972f30cfc9ad11df3c5b087f70417d096653b15b335c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Security for jobshop 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.