{"id":1198,"date":"2016-12-01T22:56:53","date_gmt":"2016-12-02T03:56:53","guid":{"rendered":"http:\/\/rpchurchill.com\/?p=1198"},"modified":"2017-02-03T13:15:43","modified_gmt":"2017-02-03T18:15:43","slug":"a-simple-discrete-event-simulation-part-51","status":"publish","type":"post","link":"https:\/\/rpchurchill.com\/wordpress\/posts\/2016\/12\/01\/a-simple-discrete-event-simulation-part-51\/","title":{"rendered":"A Simple Discrete-Event Simulation: Part 51"},"content":{"rendered":"<p><iframe loading=\"lazy\" width=\"418px\" height=\"980px\" src=\"https:\/\/www.rpchurchill.com\/demo\/des\/discrete-event-sim_20161201.html\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>Today I tried a configuration that included instances of consecutively linked Path components, one exclusive and one non-exclusive.  They both worked the way I intended them to once I cleaned up a couple of typos.<\/p>\n<p>Here&#8217;s the new code that sets the configuration.<\/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 pathA = new PathComponent();\r\n    pathA.setStartPoint(168,168);\r\n    pathA.setEndPoint(140,180);\r\n    pathA.setSpeedTime(10.0,1.0);\r\n    pathA.calcPathLength();\r\n    \r\n    entry1.assignNextComponent(pathA);\r\n    pathA.assignPreviousComponent(entry1);\r\n\r\n    var pathB = new PathComponent();\r\n    pathB.setStartPoint(140,180);\r\n    pathB.setEndPoint(168,193);\r\n    pathB.setSpeedTime(10.0,1.0);\r\n    pathB.calcPathLength();\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    pathB.assignNextComponent(queue0);\r\n    queue0.assignPreviousComponent(pathB);\r\n    \r\n    pathA.assignNextComponent(pathB);\r\n    pathB.assignPreviousComponent(pathA);\r\n    \r\n    var path1A = new PathComponent();\r\n    path1A.setStartPoint(170,304);\r\n    path1A.setEndPoint(30,316);\r\n    path1A.setSpeedTime(20,1.0);\r\n    path1A.calcPathLength();\r\n\r\n    queue0.assignNextComponent(path1A);\r\n    path1A.assignPreviousComponent(queue0);\r\n\r\n    var path1B = new PathComponent();\r\n    path1B.setStartPoint(30,316);\r\n    path1B.setEndPoint(95,329);\r\n    path1B.setSpeedTime(20,1.0);\r\n    path1B.calcPathLength();\r\n\r\n    var path2 = new PathComponent();\r\n    path2.setStartPoint(170,304);\r\n    path2.setEndPoint(245,329);\r\n    path2.setSpeedTime(20,1.0);\r\n    path2.calcPathLength();\r\n\r\n    queue0.assignNextComponent(path2);\r\n    path2.assignPreviousComponent(queue0);\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    path1B.assignNextComponent(queue1);\r\n    queue1.assignPreviousComponent(path1B);\r\n\r\n    path1A.assignNextComponent(path1B);\r\n    path1B.assignPreviousComponent(path1A);\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    path2.assignNextComponent(queue2);\r\n    queue2.assignPreviousComponent(path2);\r\n\r\n    var path3 = new PathComponent();\r\n    path3.setStartPoint(95,440);\r\n    path3.setEndPoint(95,465);\r\n    path3.setSpeedTime(20,1.0);\r\n    path3.calcPathLength();\r\n    \r\n    queue1.assignNextComponent(path3);\r\n    path3.assignPreviousComponent(queue1);\r\n    \r\n    var path4 = new PathComponent();\r\n    path4.setStartPoint(245,440);\r\n    path4.setEndPoint(245,465);\r\n    path4.setSpeedTime(20,1.0);\r\n    path4.calcPathLength();\r\n    \r\n    queue2.assignNextComponent(path4);\r\n    path4.assignPreviousComponent(queue2);\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    path3.assignNextComponent(process1);\r\n    process1.assignPreviousComponent(path3);\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    path4.assignNextComponent(process2);\r\n    process2.assignPreviousComponent(path4);\r\n    \r\n    var path5 = new PathComponent();\r\n    path5.setStartPoint(95,539);\r\n    path5.setEndPoint(170,564);\r\n    path5.setSpeedTime(30,1.0);\r\n    path5.calcPathLength();\r\n    \r\n    process1.assignNextComponent(path5);\r\n    path5.assignPreviousComponent(process1);\r\n    \r\n    var path6 = new PathComponent();\r\n    path6.setStartPoint(245,539);\r\n    path6.setEndPoint(170,564);\r\n    path6.setSpeedTime(30,1.0);\r\n    path6.calcPathLength();\r\n    \r\n    process2.assignNextComponent(path6);\r\n    path6.assignPreviousComponent(process2);\r\n\r\n    var exit1 = new ExitComponent(2.0);\r\n    exit1.defineDataGroup(90,564,80,\"#00FFFF\",\"#FF0000\",\"#FFFF00\");\r\n    \r\n    path5.assignNextComponent(exit1);\r\n    path6.assignNextComponent(exit1);\r\n    exit1.assignPreviousComponent(path5);\r\n    exit1.assignPreviousComponent(path6);\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Today I tried a configuration that included instances of consecutively linked Path components, one exclusive and one non-exclusive. They both worked the way I intended them to once I cleaned up a couple of typos. Here&#8217;s the new code that &hellip; <a href=\"https:\/\/rpchurchill.com\/wordpress\/posts\/2016\/12\/01\/a-simple-discrete-event-simulation-part-51\/\">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\/1198"}],"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=1198"}],"version-history":[{"count":2,"href":"https:\/\/rpchurchill.com\/wordpress\/wp-json\/wp\/v2\/posts\/1198\/revisions"}],"predecessor-version":[{"id":1416,"href":"https:\/\/rpchurchill.com\/wordpress\/wp-json\/wp\/v2\/posts\/1198\/revisions\/1416"}],"wp:attachment":[{"href":"https:\/\/rpchurchill.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rpchurchill.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rpchurchill.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}