This package contains the Python implementation of Action-Evolution Petri Nets, a framework for modeling and solving assignment problems. The package allows to define new assignment problems using the Action-Evolution and to learn a policy for solving the problem through PPO, a Deep Reinforcement Learning algorithm.
This guide assumes the user has a working Python 3 installation available, including the pip package manager. Download the repository, then open a bash in the main folder and create/activate a Python virtual environment by running the command
python -m venv env
.\env\Scripts\activate
Proceed by installing the required packages from requirements.txt
python -m pip install -r requirements.txt
To test the installation, run the command
python __main__.py --filename aenet.txt
If the installation was successful, you will see a stream of outputs indicating that PPO is being trained on a simple task assignment problem.
The syntax for trainining a new solver is as follows
python __main__.py --filename PROBLEM_FILE.txt --train True
It is also possible to retrieve a previously trained algorithm to resume the training
python __main__.py --filename PROBLEM_FILE.txt --train True --load True
After a solver has been trained, run the following command to check its average reward over a set of episodes (compared against a random policy)
python __main__.py --filename PROBLEM_FILE.txt --train False --test True
It is possible to train a new algorithm and test it right after the end of training
python __main__.py --filename PROBLEM_FILE.txt --train True --test True
A set of assignment problems with different characteristics were modeled in A-E PN notation as plain text files and made available in the networks folder. The problems that were modeled until now are:
- Task Assignment Problem with Hard Compatibilities (task_assignment_hard_comp.txt)
- Task Assignment Problem with Soft Compatibilities (task_assignment_soft_comp.txt)
- Dynamic Bin Packing Problem (bin_packing.txt)
- Order Picking Problem (order_picking.txt)
- Task Assignment Problem with Leaving Resources (task_assignment_leaving_resources.txt)
- Collaborative Task Assignment Problem (task_assignment_collaborative.txt)
The color-specific functions used as guards for firing transitions and as reward functions are currently collected in additional_functions.py. In a future release, they will be included in the problem definitions.