Skip to content

bpogroup/aepn-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Action-Evolution Petri Nets

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.

Installation

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.

Training a solver

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

Testing a solver

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

Environments

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)

Remarks

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.

About

Action-Evolution Petri Nets in Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages