{"id":1205,"date":"2016-12-06T06:30:07","date_gmt":"2016-12-06T11:30:07","guid":{"rendered":"http:\/\/rpchurchill.com\/?p=1205"},"modified":"2017-02-03T13:14:07","modified_gmt":"2017-02-03T18:14:07","slug":"a-simple-discrete-event-simulation-part-53","status":"publish","type":"post","link":"https:\/\/rpchurchill.com\/wordpress\/posts\/2016\/12\/06\/a-simple-discrete-event-simulation-part-53\/","title":{"rendered":"A Simple Discrete-Event Simulation: Part 53"},"content":{"rendered":"<p><iframe loading=\"lazy\" width=\"418px\" height=\"980px\" src=\"https:\/\/www.rpchurchill.com\/demo\/des\/discrete-event-sim_20161206.html\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>The framework is meant to work without including Path components, which would be the case when transfer between components is effectively instantaneous, as would be the case when simulating an information or logical system rather than a physical system of some kind.  We can see here that the system works the same way without them, although none of the queues back up as far because a lot of transit time has been removed from the model.<\/p>\n<p>Visualizations are much more difficult to follow without Path connections and the animated movement of entities.  However, once we know that the components and transfer mechanisms work as we expect, we can use them with some confidence.<\/p>\n<p>Here&#8217;s the new configuration code.<\/p>\n<pre class=\"toolbar-overlay:false wrap:false height-set:true lang:default decode:true \">\r\n    \/\/schedule for seven hours of arrivals in half-hour blocks\r\n    var arrivalSchedule = [0,0,1,5,6,6,7,8,5,4,3,1,0,0]; \r\n    var entryDistribution = [[1.0],[1.0],[1.0],[1.0],[1.0],[1.0],[1.0],[1.0],[1.0],[1.0],[1.0],[1.0],[1.0],[1.0]];\r\n    \r\n    var arrival1 = new ArrivalsComponent(30.0,arrivalSchedule,entryDistribution);\r\n    arrival1.defineDataGroup(90,2,80,\"#00FFFF\",\"#FF0000\",\"#FFFF00\");\r\n\r\n    var routingTable = [1.0];\r\n    var entry1 = new EntryComponent(2.0,routingTable);\r\n    entry1.defineDataGroup(90,105,80,\"#00FFFF\",\"#FF0000\",\"#FFFF00\");\r\n    entry1.setRoutingMethod(3);  \/\/1 single connection, 2 distribution logic, 3 model logic\r\n    \r\n    arrival1.assignNextComponent(entry1);\r\n    \r\n    var queue0 = new QueueComponent(2.0,6.0);\r\n    queue0.defineDataGroup(90,193,80,\"#00FFFF\",\"#FF0000\",\"#FFFF00\");\r\n    queue0.setRoutingMethod(2);  \/\/1 single connection, 2 distribution logic, 3 model logic\r\n\r\n    entry1.assignNextComponent(queue0);\r\n    queue0.assignPreviousComponent(entry1);\r\n    \r\n    var queue1 = new QueueComponent(2.0,3.0,3); \r\n    queue1.defineDataGroup(5,329,80,\"#00FFFF\",\"#FF0000\",\"#FFFF00\");\r\n    queue1.setRoutingMethod(1);  \/\/1 single connection, 2 distribution logic, 3 model logic\r\n    queue1.setExclusive(true);\r\n    \r\n    queue0.assignNextComponent(queue1);\r\n    queue1.assignPreviousComponent(queue0);\r\n\r\n    var queue2 = new QueueComponent(2.0,3.0,3); \r\n    queue2.defineDataGroup(175,329,80,\"#00FFFF\",\"#FF0000\",\"#FFFF00\");\r\n    queue2.setRoutingMethod(1);  \/\/1 single connection, 2 distribution logic, 3 model logic\r\n    queue2.setExclusive(true);\r\n    \r\n    queue0.assignNextComponent(queue2);\r\n    queue2.assignPreviousComponent(queue0);\r\n\r\n    var process1 = new ProcessComponent(2.0,10.0);\r\n    process1.defineDataGroup(5,465,80,\"#00FFFF\",\"#FF0000\",\"#FFFF00\");\r\n    process1.setExclusive(true);\r\n    process1.setRoutingMethod(1);  \/\/1 single connection, 2 distribution logic, 3 model logic\r\n\r\n    queue1.assignNextComponent(process1);\r\n    process1.assignPreviousComponent(queue1);\r\n\r\n    var process2 = new ProcessComponent(2.0,10.0);\r\n    process2.defineDataGroup(175,465,80,\"#00FFFF\",\"#FF0000\",\"#FFFF00\");\r\n    process2.setExclusive(true);\r\n    process2.setRoutingMethod(1);  \/\/1 single connection, 2 distribution logic, 3 model logic\r\n\r\n    queue2.assignNextComponent(process2);\r\n    process2.assignPreviousComponent(queue2);\r\n\r\n    var exit1 = new ExitComponent(2.0);\r\n    exit1.defineDataGroup(90,564,80,\"#00FFFF\",\"#FF0000\",\"#FFFF00\");\r\n    \r\n    process1.assignNextComponent(exit1);\r\n    exit1.assignPreviousComponent(process1);\r\n    process2.assignNextComponent(exit1);\r\n    exit1.assignPreviousComponent(process2);\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The framework is meant to work without including Path components, which would be the case when transfer between components is effectively instantaneous, as would be the case when simulating an information or logical system rather than a physical system of &hellip; <a href=\"https:\/\/rpchurchill.com\/wordpress\/posts\/2016\/12\/06\/a-simple-discrete-event-simulation-part-53\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[60],"tags":[121],"_links":{"self":[{"href":"https:\/\/rpchurchill.com\/wordpress\/wp-json\/wp\/v2\/posts\/1205"}],"collection":[{"href":"https:\/\/rpchurchill.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rpchurchill.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rpchurchill.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/rpchurchill.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1205"}],"version-history":[{"count":2,"href":"https:\/\/rpchurchill.com\/wordpress\/wp-json\/wp\/v2\/posts\/1205\/revisions"}],"predecessor-version":[{"id":1415,"href":"https:\/\/rpchurchill.com\/wordpress\/wp-json\/wp\/v2\/posts\/1205\/revisions\/1415"}],"wp:attachment":[{"href":"https:\/\/rpchurchill.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rpchurchill.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rpchurchill.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}