GENERATION OF EPC BASED SIMULATION MODELS Prof. Dr. Christian Müller Department of Management and Business Computing Technical University of Applied Sciences Wildau Bahnhofstrasse, D-15745 Wildau, Germany christian.mueller@th-wildau.de EURO 2012 Vilnius, Lithuania 8-11 July 2012 Generation Of Epc Based Simulation Models - 1 -
Introduction Simulation of Business Processes Business Process Model generate Discrete Event Simulation Model Tools: EPC: BPMN: bflow Activity Open Source Agenda Concept Describing Simulation Models with Epc Model Extensions Fazit Tools: Desmo-J, Ptolemy, Omnet++, C++SIM,... Generation Of Epc Based Simulation Models - 2 -
Concept Generation Of Epc Based Simulation Models - 3 -
Simulation Process Model /ECMS/Demo/Model.epc /ECMS/Demo/Customer.epc Generation Of Epc Based Simulation Models - 4 -
Generate Desmo-J Simulation Generation Of Epc Based Simulation Models - 5 -
Run Desmo-J Simulation Generation Of Epc Based Simulation Models - 6 -
Model Epc /ECMS/Demo/Model.epc /ECMS/Demo/Customer.epc Generation Of Epc Based Simulation Models - 7 -
Epc Basic Generation Of Epc Based Simulation Models - 8 -
XOR Decisions Generation Of Epc Based Simulation Models - 9 -
Loops Generation Of Epc Based Simulation Models - 10 -
Parallel Processing I Generation Of Epc Based Simulation Models - 11 -
Parallel Processing II clone split split split interrupt wait join join synchronize join synchronize Split Join (normal) Join (interrupted) Generation Of Epc Based Simulation Models - 12 -
Model Extensions Customer: Shopping list Supermarket: Inventory management Generation Of Epc Based Simulation Models - 13 -
The generated simulation model must be extended generated Manual extensions model.demo Model.java x Inventory list Master_customer.java x Shopping list Slave_cashier.java x Rule_cashier.java x Logic_Customer.java x Epc_Customer.java x Product choosing function model.demo.myextensions ArticleShop.java Article in inventory list ArticleCustomer.java Article in shopping list Generation Of Epc Based Simulation Models - 14 -
@Generated(value = { "RememberCode", "yes" ) public class Model extends ModelAnimation { //@@_begin of declaration individual code public Map<Long, ArticleShop> myext_inventorylist = null; //@@_end of declaration individual code public Model(String name, CmdGeneration cmdgen, boolean showinreport, boolean showintrace, boolean showinanimation) { //some generated constructor code //@@_begin of constructor individual code // initialize inventory list this.myext_inventorylist = new HashMap<Long, ArtikelShop>(); for(long i=0; i<1000; i++){ ArticleShop article = new ArticleShop(); article.name = "Article_"+i; article.nr = i; article.inventory = 100.0; this.myext_inventorylist.put(i, article); //@@_end of constructor individual code //some other generated methods public class ArticleShop { public long nr; public String name; public double inventory; Generation Of Epc Based Simulation Models - 15 -
@Generated(value = { "RememberCode", "yes" ) public class Master_customer extends EpcProcess { //@@_begin of declaration individual code public Map<Long, ArtikelCustomer> myext_shoppinglist = null; //@@_end of declaration individual code public Master_customer(Model model, String name, EpcProcess parent, EPC_interface epc){ //@@_begin of constructor individual code // initialize shopping list this.myext_shoppinglist = new HashMap<Long, ArticleCustomer>(); int countarticle = model.myext_inventorylist.size(); DiscreteDistUniform randomarticle = new DiscreteDistUniform(model,...); for(int i=0; i<10; i++){ long articlenr = randomarticle.sample(); String articlename = model.myext_inventorylist.get(articlenr).name; if(this.myext_shoppinglist.containskey(articlenr)){ this.myext_shoppinglist.get(articlenr).demand += 1.0; else{ ArticleCustomer article = new ArticleCustomer(); article.nr = articlenr; article.name = articlename; article.demand = 1.0; this.myext_shoppinglist.put(articlenr, article); //@@_end of constructor individual code public class ArticleCustomer { public long nr; public String name; public double demand; Generation Of Epc Based Simulation Models - 16 -
@Generated(value = { "RememberCode", "yes" ) public class Epc_Customer extends Logic_Customer{ /** * Type: epc:function * Name: product_choosing * Resources: * Id: _id_16_function_product_choosing * EpcFile: /ECMS/Demo1/Customer.epc */ protected void _id_16_function_product_choosing(epcprocess proc, List<EpcResource> resources){ String Duration_TimeUnit = "MINUTES", String Duration_Distribution = "TRIA"; String Duration_Tria_Peak = "30", Duration_Tria_Lower = "5", Duration_Tria_Upper = "60"; //@@_begin of individual code for this method // product_choosing Master_customer customer = (Master_customer) proc; for(long key: customer.myext_shoppinglist.keyset()){ double demand = customer.myext_shoppinglist.get(key).demand; if(model.myext_inventorylist.get(key).inventory >= demand){ model.myext_inventorylist.get(key).inventory -= demand; else{ model.myext_inventorylist.get(key).inventory = 0.0; //@@_end of individual code for this method Generation Of Epc Based Simulation Models - 17 -
Model improvement Choose each article separately Generation Of Epc Based Simulation Models - 18 -
@Generated(value = { "RememberCode", "yes" ) public class Master_customer extends EpcProcess { //@@_begin of declaration individual code public Map<Long, ArtikelCustomer> myext_shoppinglist = null; public Iterator<ArticleCustomer> myext_iterator_shoppinglist; //@@_end of declaration individual code public Master_customer(Model model, String name, EpcProcess parent, EPC_interface epc){ //@@_begin of constructor individual code // initialize shopping list this.myext_shoppinglist = new HashMap<Long, ArticleCustomer>(); int countarticle = model.myext_inventorylist.size(); DiscreteDistUniform randomarticle = new DiscreteDistUniform(model,...); for(int i=0; i<10; i++){ //... this.myext_iterator_shoppinglist = this.myext_shoppinglist.values().iterator(); //@@_end of constructor individual code Generation Of Epc Based Simulation Models - 19 -
@Generated(value = { "RememberCode", "yes" ) public class Epc_Customer extends Logic_Customer{ protected boolean _id_29_event_article choosing_is finished(epcprocess proc){ String Condition = "generate"; boolean out = true; //@@_begin of individual code for this method // check shoppinglist is finnished Master_customer customer = (Master_customer) proc; out =! customer.myext_iterator_shoppinglist.hasnext(); //@@_end of individual code for this method return out; protected boolean _id_30_event_article_choosing_isn_t_finished(epcprocess proc){ String Condition = "generate"; boolean out = false; //@@_begin of individual code for this method // check shoppinglist isn't finnished Master_customer customer = (Master_customer) proc; out = customer.myext_iterator_shoppinglist.hasnext(); //@@_end of individual code for this method return out; Generation Of Epc Based Simulation Models - 20 -
protected void _id_27_function_choose_a article(epcprocess proc, List<EpcResource> resources){ String Duration_TimeUnit = "MINUTES"; String Duration_Distribution = "UNIFORM"; String Duration_Uniform_Lower = "1"; String Duration_Uniform_Upper = "3"; //@@_begin of individual code for this method // choose next article in shopping list Master_customer customer = (Master_customer) proc; ArticleCustomer article = customer.myext_iterator_shoppinglist.next(); double demand = article.demand; if(model.myext_inventorylist.get(article.nr).inventory >= demand){ model.myext_inventorylist.get(article.nr).inventory -= demand; else{ model.myext_inventorylist.get(article.nr).inventory = 0.0; //@@_end of individual code for this method Generation Of Epc Based Simulation Models - 21 -
Fazit A generator build from a EPC model a simulation model. The simulation model is a Java application, based on DesmoJ framework. The simulation model can be manually extended. With this extensions the simulation model isn't restricted by the EPC modeling language Further developments Language extensions Statistical analysis, controlled by EPC attributes Tutorial writing Generation of BPMN based simulation models. See also: http://www.scs-europe.net/conf/ecms2012/ecms2012%20accepted%20papers/ibs_ecms_0028.pdf Generation Of Epc Based Simulation Models - 22 -