JSON Application Programming Interface for Discrete Event Simulation Data Exchange
Total Page:16
File Type:pdf, Size:1020Kb
JSON Application Programming Interface for Discrete Event Simulation data exchange Ioannis Papagiannopoulos Enterprise Research Centre Faculty of Science and Engineering Design and Manufacturing Technology University of Limerick Submitted to the University of Limerick for the degree of Master of Engineering 2015 1. Supervisor: Prof. Cathal Heavey Enterprise Research Centre University of Limerick Ireland ii Abstract This research is conducted as part of a project that has the overall aim to develop an open source discrete event simulation (DES) platform that is expandable, and modular aiming to support the use of DES at multi-levels of manufacturing com- panies. The current work focuses on DES data exchange within this platform. The goal of this thesis is to develop a DES exchange interface between three different modules: (i) ManPy an open source discrete event simulation engine developed in Python on the SimPy library; (ii) A Knowledge Extraction (KE) tool used to populate the ManPy simulation engine from shop-floor data stored within an Enterprise Requirements Planning (ERP) or a Manufacturing Execution System (MES) to allow the potential for real-time simulation. The development of the tool is based on R scripting language, and different Python libraries; (iii) A Graphical User Interface (GUI) developed in JavaScript used to provide an interface in a similar manner to Commercial off-the-shelf (COTS) DES tools. In the literature review the main standards that could be used are reviewed. Based on this review and the requirements above, the data exchange format standard JavaScript Object Notation (JSON) was selected. The proposed solution accom- plishes interoperability between different modules using an open source, expand- able, and easy to adopt and maintain, in an all inclusive JSON file. In this way, the DES API model offers the means for the configuration, synchronization, and maintenance of the different DES platform instances in a decentralized manner. The presented exchange data model offers the means to represent (i) any results returned by the simulation engine, (ii) configuration data for various platform in- stances, and (iii) extra input data collected from various data sources. In addition, the DES API data model offers an embedded JSON schema for the validation of the DES model graphs, and for the configuration of any GUI used for DES model design. A full description of the JSON DES API data model is provided with the different elements of the interface detailed. The DES API data model consists of six parts: (i) an element which is used for the configuration and the synchroniza- tion of the platform; (ii) an embedded JSON schema for the creation of consistent models; (iii) a graph that contains the topology of the model (iv) an element that contains DES related data, such as Bills Of Materials (BOM), or Work In Progress (WIP); (iv) an element that contains the results returned by the simu- lation engine; (v) and an element that contains general information crucial for a simulation run (e.g. maximum simulation run time, simulation time units). The proposed DES API data model is validated against three different real use case scenarios, placing emphasis on the various limitations they posed on the DES data exchange and on the API data model. The solution proposed for one pilot case is detailed in full with different limitations posed by the different specifica- tions and pilot cases specified. Various expansions or enhancements that can be implemented are pointed out in the conclusions. Declaration I herewith declare that I have produced this paper without the pro- hibited assistance of third parties and without making use of aids other than those specified; notions taken over directly or indirectly from other sources have been identified as such. This paper has not previously been presented in identical or similar form to any other Irish or foreign examination board. The thesis work was conducted from 2013 to 2015 under the supervi- sion of Prof. Cathal Heavey at University of Limerick. Ioannis Papagiannopoulos Limerick, 2015 Acknowledgements The current thesis was fully funded from the European Union Sev- enth Framework Programme (FP7-2012-NMP-ICT-FoF) under grant agreement no 314364. First of all, I would like to thank my supervisor Prof. Cathal Heavey. His clear scientific insight and calm approach to research makes for a great supervisor. His guidance and support have been crucial for the successful delivery of this work. I would also like to express my gratitude to all the members of DREAM project for their assistance and fruitful collaboration throughout this work. I also wish to thank all the colleagues from the Enterprise Research Centre, and the Department of Design and Manufacturing Technology, University of Limerick. Special thanks to the really good colleagues and friends, George and Panos. Finally, I would like to thank my parents and siblings for their support. I would like to dedicate this work to my family; Dimitris, Konstantina, Despoina, Nikos, Vasiliki. Contents List of Tables vii List of Figures ix Glossary xiii List of Publications xvii 1 Introduction 1 1.1 Discrete Event Simulation . 1 1.2 Manufacturing Processes Representation . 3 1.3 DES data exchange . 4 1.4 Problem Statement . 6 1.5 Research Objectives . 7 1.6 Thesis Outline . 8 2 Literature Review 11 2.1 Data Exchange Formats . 12 2.1.1 Human readable formats . 13 2.1.1.1 XML . 14 2.1.1.2 JSON . 17 2.1.1.3 YAML . 18 2.1.1.4 Other candidates . 20 2.1.2 Presentation oriented languages . 24 2.2 Data Exchange Standards in Simulation . 25 2.3 Data Exchange Standards in DES . 26 iii CONTENTS 2.3.1 SDX . 27 2.3.2 NIST SDM . 27 2.3.3 OpenSML . 28 2.3.4 SRML . 28 2.3.5 NESIS . 29 2.3.6 STEP-ISO 10303 . 29 2.3.7 AutomationML . 30 2.3.8 ISA-95 . 31 2.3.9 CMSD . 31 2.4 Manufacturing Processes Representation . 32 2.5 Selecting a Data Exchange Format . 34 2.6 Selecting a Simulation Data Exchange Model . 36 2.7 Conclusions . 37 3 Simulation Platform Requirements 39 3.1 Simulation Platform Objectives . 39 3.2 Platform components . 41 3.2.1 Simulation Engine - ManPy . 41 3.2.2 Knowledge extraction module - KE tool . 41 3.2.3 Graphical User Interface . 42 3.3 Architecture and Information Flow . 43 3.3.1 Preprocessing Plugins . 46 3.3.2 Execution Plugins . 46 3.3.3 Post-processing Plugins . 47 3.4 Conclusions . 47 4 DES Application Programming Interface data model 49 4.1 Development considerations . 49 4.2 Data exchange model layout . 51 4.3 DES data exchange model . 53 4.3.1 Directed Graph model representation . 56 4.3.1.1 Node ......................... 57 4.3.1.2 Edge ......................... 60 4.3.2 General ............................ 61 iv CONTENTS 4.3.3 Input .............................. 62 4.3.4 Result ............................. 65 4.4 DES platform configuration and synchronization . 67 4.4.1 Embedded JSON schema . 67 4.4.1.1 Definitions . 72 4.4.2 Configuring the application platform . 74 4.4.2.1 Views . 76 4.4.2.2 Plugins . 80 4.4.3 Collecting and collating data from various data sources . 82 4.4.4 DES result data processing . 85 4.5 Conclusions . 86 5 Validation of JSON API 89 5.1 Problem statement . 89 5.1.1 Description of CASE1 Case Study . 90 5.1.1.1 Production Processes . 91 5.1.1.2 Pilot Case . 92 5.1.2 Description of CASE2 Case Study . 93 5.1.2.1 Production Processes . 93 5.1.2.2 Pilot Case . 95 5.1.3 Description of CASE3 Case Study . 97 5.1.3.1 Production Processes . 97 5.1.3.2 Pilot Case . 98 5.1.3.3 Requirements . 100 5.2 Configuration . 101 5.2.1 Views . 102 5.2.2 Plugins . 105 5.2.3 DES object Classes . 109 5.3 Input . 112 5.4 Parsing . 114 5.5 Results evaluation . 120 5.6 Conclusions . 123 v CONTENTS 6 Conclusions and Future Directions 125 6.1 Summary . 125 6.2 Conclusions . 126 6.3 Contributions and Future Work . 127 6.3.1 Expansion considerations . 128 Appendix A: Lightweight Markup Languages 131 Appendix B: General Properties of pilot case CASE3 134 Appendix C: Plugins 135 Appendix C: Processing Plugins . 135 Appendix C: Pre-processing Plugins . 139 Appendix C: Time-support plugin . 142 Appendix D: JSON DES API instance for pilot case CASE3 145 References 147 vi List of Tables 2.1 Data Exchange Formats' attributes . 14 2.2 XML schemas . 16 2.3 Simulation Data Representation & Exchange Formats . 26 2.4 Graphical Representation Categories (Lacy 2006) . 33 1 Lightweight Markup Languages . 131 vii LIST OF TABLES viii List of Figures 3.1 Simulation Platform Design . 40 3.2 KE tool . 42 3.3 Graphical User interface . 43 3.4 Graphical User interface results . 44 3.5 Information flow . 45 4.1 Information flow . 52 4.2 JSON API structure . 53 4.3 Graph layout . 54 4.4 input layout . 56 4.5 result layout . 56 4.6 Simple nodes graph . 59 4.7 Simple nodes graph with edge . 60 4.8 input layout . 62 4.9 Time distribution . 74 4.10 General data input . 76 4.11 Views panel . 78 4.12 Spreadsheet gadget . 78 4.13 WIP example . ..