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’s the new code that sets the configuration.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
//schedule for seven hours of arrivals in half-hour blocks var arrivalSchedule = [0,0,1,5,6,6,7,8,5,4,3,1,0,0]; 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]]; var arrival1 = new ArrivalsComponent(30.0,arrivalSchedule,entryDistribution); arrival1.defineDataGroup(90,2,80,"#00FFFF","#FF0000","#FFFF00"); var routingTable = [1.0]; var entry1 = new EntryComponent(2.0,routingTable); entry1.defineDataGroup(90,105,80,"#00FFFF","#FF0000","#FFFF00"); entry1.setRoutingMethod(3); //1 single connection, 2 distribution logic, 3 model logic arrival1.assignNextComponent(entry1); var pathA = new PathComponent(); pathA.setStartPoint(168,168); pathA.setEndPoint(140,180); pathA.setSpeedTime(10.0,1.0); pathA.calcPathLength(); entry1.assignNextComponent(pathA); pathA.assignPreviousComponent(entry1); var pathB = new PathComponent(); pathB.setStartPoint(140,180); pathB.setEndPoint(168,193); pathB.setSpeedTime(10.0,1.0); pathB.calcPathLength(); var queue0 = new QueueComponent(2.0,6.0); queue0.defineDataGroup(90,193,80,"#00FFFF","#FF0000","#FFFF00"); queue0.setRoutingMethod(2); //1 single connection, 2 distribution logic, 3 model logic pathB.assignNextComponent(queue0); queue0.assignPreviousComponent(pathB); pathA.assignNextComponent(pathB); pathB.assignPreviousComponent(pathA); var path1A = new PathComponent(); path1A.setStartPoint(170,304); path1A.setEndPoint(30,316); path1A.setSpeedTime(20,1.0); path1A.calcPathLength(); queue0.assignNextComponent(path1A); path1A.assignPreviousComponent(queue0); var path1B = new PathComponent(); path1B.setStartPoint(30,316); path1B.setEndPoint(95,329); path1B.setSpeedTime(20,1.0); path1B.calcPathLength(); var path2 = new PathComponent(); path2.setStartPoint(170,304); path2.setEndPoint(245,329); path2.setSpeedTime(20,1.0); path2.calcPathLength(); queue0.assignNextComponent(path2); path2.assignPreviousComponent(queue0); var queue1 = new QueueComponent(2.0,3.0,3); queue1.defineDataGroup(5,329,80,"#00FFFF","#FF0000","#FFFF00"); queue1.setRoutingMethod(1); //1 single connection, 2 distribution logic, 3 model logic queue1.setExclusive(true); path1B.assignNextComponent(queue1); queue1.assignPreviousComponent(path1B); path1A.assignNextComponent(path1B); path1B.assignPreviousComponent(path1A); var queue2 = new QueueComponent(2.0,3.0,3); queue2.defineDataGroup(175,329,80,"#00FFFF","#FF0000","#FFFF00"); queue2.setRoutingMethod(1); //1 single connection, 2 distribution logic, 3 model logic queue2.setExclusive(true); path2.assignNextComponent(queue2); queue2.assignPreviousComponent(path2); var path3 = new PathComponent(); path3.setStartPoint(95,440); path3.setEndPoint(95,465); path3.setSpeedTime(20,1.0); path3.calcPathLength(); queue1.assignNextComponent(path3); path3.assignPreviousComponent(queue1); var path4 = new PathComponent(); path4.setStartPoint(245,440); path4.setEndPoint(245,465); path4.setSpeedTime(20,1.0); path4.calcPathLength(); queue2.assignNextComponent(path4); path4.assignPreviousComponent(queue2); var process1 = new ProcessComponent(2.0,10.0); process1.defineDataGroup(5,465,80,"#00FFFF","#FF0000","#FFFF00"); process1.setExclusive(true); process1.setRoutingMethod(1); //1 single connection, 2 distribution logic, 3 model logic path3.assignNextComponent(process1); process1.assignPreviousComponent(path3); var process2 = new ProcessComponent(2.0,10.0); process2.defineDataGroup(175,465,80,"#00FFFF","#FF0000","#FFFF00"); process2.setExclusive(true); process2.setRoutingMethod(1); //1 single connection, 2 distribution logic, 3 model logic path4.assignNextComponent(process2); process2.assignPreviousComponent(path4); var path5 = new PathComponent(); path5.setStartPoint(95,539); path5.setEndPoint(170,564); path5.setSpeedTime(30,1.0); path5.calcPathLength(); process1.assignNextComponent(path5); path5.assignPreviousComponent(process1); var path6 = new PathComponent(); path6.setStartPoint(245,539); path6.setEndPoint(170,564); path6.setSpeedTime(30,1.0); path6.calcPathLength(); process2.assignNextComponent(path6); path6.assignPreviousComponent(process2); var exit1 = new ExitComponent(2.0); exit1.defineDataGroup(90,564,80,"#00FFFF","#FF0000","#FFFF00"); path5.assignNextComponent(exit1); path6.assignNextComponent(exit1); exit1.assignPreviousComponent(path5); exit1.assignPreviousComponent(path6); |