The implementation of discrete-event simulation and demand forecasting using Temporal Fusion Transformers to validate spare parts inventory policy for petrochemicals industry

Main Article Content

Sanit Innuphat
Manachai Toahchoodee


One of the important strategic factors of petrochemicals plant maintenance is the spare parts inventory policy, It is significant for the efficiency, reliability, and productivity of the petrochemicals industry. An unsuitable spare part inventory policy will lead to a loss in long engineering machinery downtime due to a shortage of spare parts. To implement the spare parts inventory policy which is able to fulfill the future demand for spare parts, calculation by various statistical theories and working processes is used to custom the spare parts inventory policy. However, to validate whether or not the customized spare parts inventory policy is suitable, the discrete-event simulation library SimPy is used to mimic the actual spare parts inventory system. It must be involved in the performance evaluation process of the customized spare parts inventory policy. The inventory simulation model consists of many events depending on the supply chain system. The crucial event which is the most complex for the simulation of spare parts inventory is the demand event. This work applies the demand forecasting technique to the simulation by using deep learning with a prebuilt architecture model called Temporal Fusion Transformers (TFT). The averaged MAE of the point predictions from a global model is 0.4874+/- 6.7744 on the validation dataset and 0.6424+/-3.4963 on the test dataset. Our method predicts a quantile forecast of the future demand which is able to handle the stochastic nature of the spare parts demand in the petrochemicals industry and the result from the simulation outcome is more accurate and close to the outcome from an actual inventory system. The information from the analysis of the simulation outcome is used by the inventory management team to make decisions about the custom inventory policy before deploying it to the actual system.

Article Details

How to Cite
S. Innuphat and M. Toahchoodee, “The implementation of discrete-event simulation and demand forecasting using Temporal Fusion Transformers to validate spare parts inventory policy for petrochemicals industry”, ECTI-CIT Transactions, vol. 16, no. 3, pp. 247–258, Jun. 2022.
Research Article


P. Chaovalitwongse, Determining Inventory Policy: Theories and a Systematic Thinking Approach, BKK: ChulaPress, 2018.

R. Kripunyapong , E. Shayan and F. Ghotb, “Supply Chain Management Problems: A Review,” in Proceedings of the 2nd International Conference on Operations and Supply Chain Managemen, BKK, 2007.

S. Al-Fedaghi and N. Al-Huwais, “Conceptual Modeling of Inventory Management Processes as a Thinging Machine,” International Journal of Advanced Computer Science and Applications (IJACSA), vol. 9, no. 11, 2018.

F. Zhang and Z. Guan, “Inventory management for spare parts on engineering machinery,” 2015 Chinese Automation Congress (CAC), pp. 1951-1955, 2015.

E. Spiliotis, S. Makridakis, A.-A. Semenoglou and V. Assimakopoulos, “Comparison of statistical and machine learning methods for daily SKU demand forecasting,” Operational Research, 2020.

A. Oroojlooyjadid, L. Snyder and M. Takac, “Applying Deep Learning to the Newsvendor Problem,” 6 March 2018. [Online]. Available:

A. M. Law, Simulation Modelling and Analysis, New York: McGraw-Hill Education, 2015.

H. Susanto, M. N. Almunawar, M. S. Aksoy and Y. C. Tuan, “A Simulation Approach Paradigm: An Optimization and Inventory Challenge Case Study,” 28 March 2012. [Online]. Available:

A. Bhosekar, S. Eksioglu, T. Isik and R. Allen, “A Discrete Event Simulation Model for Coordinating Inventory Management and Material Handling in Hospitals,” 11 June 2020. [Online]. Available:

T. SimPy, “SimPy Documentation,” 15 April 2020. [Online]. Available: en/latest/pdf/.

A. Agarwal, “Validation of Inventory models for Single-echelon Supply Chain using Discrete event Simulation,” Chicago, 2018.

A. Agarwal, “Multi-echelon Supply Chain Inventory Planning using Simulation-Optimization with Data Resampling,” Chicago, 2019.

G. Sharma, V. Tripathi, M. Mahajan and A. K. Srivastava, “Comparative Analysis of Supervised Models for Diamond Price Prediction,” 2021 11th International Conference on Cloud Computing, Data Science & Engineering (Confluence), pp. 1019-1022, 2021.

K. Bandara, P. Shi, C. Bergmeir, H. Hewamalage and Q. Tran, Sales Demand Forecast in E-commerce using a Long Short-Term Memory Neural Network Methodology.

D. Salinas, V. Flunkert and J. Gasthaus, “DeepAR: Probabilistic Forecasting with Autoregressive Recurrent Networks,” 22 Febuary 2019. [Online]. Available: abs/1704.04110.

B. Lim, S. O. Arik, N. Loeffb and T. Pfister, “Temporal Fusion Transformers for Interpretable Multi-horizon Time Series Forecasting,” 27 September 2020. [Online]. Available: https: //

J. Beitner, “PyTorch Forecasting Documentation,” 20 September 2020. [Online]. Available: https://pytorch-forecasting.

E. Stevens, L. Antiga and T. Viehmann, Deep Learning with PyTorch, NY: Manning Publica- tions Co., 2020.

L. Buitinck, G. Louppe, M. Blonde, F. Pe- dregosa, A. Mueller, O. Grisel, V. Niculae, P. Prettenhofer, A. Gramfort, J. Grobler, R. Layton, J. Vanderplas, A. Joly, B. Holt and G. Varoquaux, “API design for machine learning software: experiences from the scikit-learn project,” 2013. [Online]. Available: abs/1309.0238.

M. Choy and M. Cheong, “Identification of Demand through Statistical Distribution Modeling for Improved Demand Forecasting,” 1 October 2011. [Online]. Available: