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.
- 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
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:
sudo apt-get install build-essential pkg-config cmake git curl zip unzip tar autoconf autoconf-archive libtool
sudo apt-get install libxmu-dev libxi-dev libgl-dev libglu1-mesa-dev
sudo apt-get install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev
sudo apt-get install python3 python3-dev
sudo apt-get install linux-tools-common linux-tools-generic
sudo /usr/lib/linux-tools-6.8.0-36/perf
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
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
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.
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
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()
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
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
If you have any questions or feedback, please open an issue on the GitHub repository.