FJSP-DRL
FJSP-DRL copied to clipboard
This repository is the official implementation of the paper “Flexible Job Shop Scheduling via Dual Attention Network Based Reinforcement Learning”. IEEE Transactions on Neural Networks and Learning Sy...
FJSP-DRL
This repository is the official implementation of the paper “Flexible Job Shop Scheduling via Dual Attention Network Based Reinforcement Learning”. IEEE Transactions on Neural Networks and Learning Systems, 2023.
Quick Start
requirements
- python $=$ 3.7.11
- argparse $=$ 1.4.0
- numpy $=$ 1.21.6
- ortools $=$ 9.3.10497
- pandas $=$ 1.3.5
- torch $=$ 1.11.0+cu113
- torchaudio $=$ 0.11.0+cu113
- torchvision $=$ 0.12.0+cu113
- tqdm $=$ 4.64.0
introduction
datasaves the instance files including testing instances (in the subfolderBenchData,SD1andSD2) and validation instances (in the subfolderdata_train_vali) .modelcontains the implementation of the proposed framework.or_solutionsaves the results solved by Google OR-Tools.test_resultssaves the results solved by priority dispatching rules and DRL models.train_logsaves the training log of models, including information of the reward and validation makespan.trained_networksaves the trained models.common_utils.pycontains some useful functions (including the implementation of priority dispatching rules mentioned in the paper) .data_utils.pyis used for data generation, reading and format conversion.fjsp_env_same_op_nums.pyandfjsp_env_various_op_nums.pyare implementations of fjsp environments, describing fjsp instances with the same number of operations and different number of operations, respectively.ortools_solver.pyis used for solving the instances by Google OR-Tools.params.pydefines parameters settings.print_test_result.pyis used for printing the experimental results into an Excel file.test_heuristic.pyis used for solving the instances by priority dispatching rules.test_trained_model.pyis used for evaluating the models.train.pyis used for training.
train
python train.py # train the model on 10x5 FJSP instances using SD2
# options (Validation instances of corresponding size should be prepared in ./data/data_train_vali/{data_source})
python train.py --n_j 10 # number of jobs for training/validation instances
--n_m 5 # number of machines for training/validation instances
--data_source SD2 # data source (SD1 / SD2)
--data_suffix mix # mode for SD2 data generation
# 'mix' is thedefault mode as defined in the paper
# 'nf' means 'no flexibility' (generating JSP data)
--model_suffix demo # annotations for the model
evaluate
python test_trained_model.py # evaluate the model trained on '10x5+mix' of SD2 using the testing instances of the same size using the greedy strategy
# options (Model files should be prepared in ./trained_network/{model_source})
python test_trained_model.py --data_source SD2 # source of testing instances
--model_source SD2 # source of instances that the model trained on
--test_data 10x5+mix # list of instance names for testing
--test_model 10x5+mix # list of model names for testing
--test_mode False # whether using the sampling strategy
--sample_times 100 # set the number of sampling times
Cite the paper
@ARTICLE{10246328,
author={Wang, Runqing and Wang, Gang and Sun, Jian and Deng, Fang and Chen, Jie},
journal={IEEE Transactions on Neural Networks and Learning Systems},
title={Flexible Job Shop Scheduling via Dual Attention Network-Based Reinforcement Learning},
year={2023},
volume={},
number={},
pages={1-12},
doi={10.1109/TNNLS.2023.3306421}
}
Reference
- https://github.com/songwenas12/fjsp-drl/
- https://github.com/zcaicaros/L2D
- https://github.com/google/or-tools
- https://github.com/Diego999/pyGAT