Logistics.postech.ac.kr



2018 ???? ???? ?????? ?? ???2018.12.26 ~ 2019.02.15 (8?)Logistics Lab.????: ??? ???????: ???????: ?????IntroductionObjectivesLiterature ReviewBackgroundPrecedent ResearchMethodAnyLogic ModelMainSimulation ScenariosExperimentsResultsConclusionReviewReferencesAppendix1 Introduction1.1 Objectives???? ???? ???? ?????? ???? ??? ??? ??? ?? ??? ????. ??, ?? ? ????? ??? ?????? ???? ??? ?? ?? ??, ??????? ???? ? ?? ??? ??. ?? ?? ??? ?? ??? ?? ???? ??? ??? ?? ? ??. ??? ???? ?? ?? ??? ??? ?? ??, ??????, ???, ?? ??, ???? ???? ????? ?? ???? ??? ???? ??. ??? ???? ?? ??? ?? ???? ???? ???? ? ??.??, ???? ???? ?? ???? ??? ???? ?? ?? ??? ?? ??? ???? ???? ??? ????. ???? ???? ???? ???? ?? ???? ???? ????? ? ? ???, ????? ??, ?? ? ??? ?? ???? ???? ??? ????. ?? ???? ???? ???? ?? ??? ?? ??? ???? ??? ???? ?? ????? ???? ???? ??? ??? ???? ???? ???? ??? ????? ????? ???? ??? ? ?? ???.? ????? ??? ???? ???? ????? ?? ???? ????? ?? ??? ??? ?? ??? ????. ??? ????? ??? ?? ????? AnyLogic ??? ????. 4? ????? ????? ???? ???? ?????? ???? ???? ??? ???? ?? ????.1.2 Literature Review???? ??? ???? ???? ?? ????? ???? ???? ???? ?? ??? ????. ??? ??, ?? ?? ?? ??? ?? ???? ??? ????? ???? ???? ????.1.2.1 Background???? ???? ????? ???? ????? ???? ??? ???? ??? ???? ??. ? ???? ? ??? ??? ??? ??? ??, ?? ??????, ?? ??? ?? ?? ??? ???? ??.1.2.1.1 ?????? ??? ????????? ???? ???? ???? ?? ??? ??? ??? ???? ????? ????????????? 1?? ??? j? ?? ?? i? ??? ? ?? ???? ?? ???? ????? qij? ??.????????? ???? ??? ??? ?? ?? ??? ????? ????? ??? ? ????? ???? ???? ?????? sj?? ??. ????? ????? 2,200pcuphgl, ??? ? ??? ??? 1,980pcuphgl? ????.???????? qij? ?????? sj? ?? ?? ??? λij? ??.?? ?????? ???? ?? ? ?? i? ??, ? ??? ???? ???? ??? ??? ?? ? ???? ? ??? ?? ??? λi? ???.??? ???? ??? ??? λi? ?? ????? ?? ?? ??? ??? λ??.??????? ??? ??? 1????? ???? ??? ?? ??? ??, ??? ?? ????? 60?? ??? ??? ????? ???.????? i? ??????? ???? C? ?? ?? ??? gi? ??.?? ???????? ? ???? ????? ?? ???? ???? ?? ???(?? ??)? ??????? ?? ?? ????.1.2.1.2 ?? ????????????? ???? ??? ?? ??? ??? ?? ?????? ??? ?? ?? ??? ??? ??? ? ??? ????? ??. ????? ?? 5?? ??, ?? ?? ??? ??? 1~2?? ??????? ??, ???? ?? ???? ??? ??? ???? ??? ????. ?? ? ?????? ???? ???? ???? ?, ??? ????, ?????, ??? ???? ?? ???? ??. ????? ??? ? ? ?? ?? ??????? ?? ??? ?? ????.Y=Tb+ V2d+ W+LV-Ts???, Y=???????V=????m/sd=?????ms2, 5.0ms2 ??W=??? ????mL=????mTb=?????? ???, 1.0? ??Ts=?????? ? ?????, 1.5? ??1.2.1.3 ???? ??????? ?? ??? ??? ?? ??? ??? ???? ??? ? ?????, ? ??? ????? ???? ??? ???? ???? ?? ????? ????. ?? ?????? ????? ? ??? ??????? ?? ???, ?? 180??? ???? ????? 120? ?? ??? ????? ??. ????? ???? ?? ??? ??? ???? ??? ????? Webster ??? ???.C=1.5×Loss+51.0- inλi???, C=?? ?????λi=?? ???Loss=??? ?????, nl+Rn=???l=??? ?? ?????R=??? ?? ??? ???1.2.1.4 ??? ???? ???? ???? ??? ??? ????? ?? ??? ???? ?? ??? ??????? ???? ??? ???? ???????? ?? ????? ?? ??? 90? ??? ??? 5??, 100? ??? ??? 10?? ?????? ??? ????? ????? ???????? ??? ??? ?? ??? ????.??? ? ??????=??? ????-????+?????? ?? ????=? ??????×??? ???????? ????? ???????= 15? ,????? ??5? , ????? ?? ??1.2.1.5 ?? ?????? ?????? ?? ????? FHWA(Federal Highway Administration)?? ???? MUTCD(Manual on Uniform Traffic Control Devices)? Koonce et al. (2008)? ???? ? ?? ???? ???? ??. ????? ???? ?? ??? ?? ??? ??? ?? ??? ??? ??? ??? ???? ??? ??, ?? ??? ?? ? ?? ??? ??? ???? ??? ??? ??.CP=t+1.47v2a+32.2g+W+Lv1.47vwhere, CP= change period (yellow change plus red clearance intervals), st= perception-reaction time to the onset of a yellow indication, sv= approach speed, mpha=deceleration rate in response to the onset of a yellow indicationg= grade, with uphill positive and downhill negative (percent grade / 100), ft/ftW= width of intersection, ftLv= length of vehicle??? ?? ?? ????, ???? ???? ???? grade? ??? ?? ??? ????? ???? ?? ?????? ? ????? ??? parameter? ??. ??, ?? ?? ????? ??? ??, ??? ?? ??? ??? ??? ??.Table SEQ Table \* ARABIC 1 Typical minimum and maximum green intervalPhase TypeFacility TypeMinimum Green, sMaximum Green, sThroughMajor Arterial>40 mph10 to 1550 to 70Major Arterial≤40 mph7 to 1540 to 60Minor Arterial4 to 1030 to 50Collector, Local, Driveway2 to 1020 to 40Left TurnAny2 to 515 to 30Table 1?? ? ? ??, Traffic Signal Manual?? ?? ??? ???? ???? ???? ??? ??? ??? ??? ??? ?? ???? ???? ??.1.2.2 Precedent Research2018??? 2?? ???????? ??? ??? ??? ?? ???? ??? ??? ????. AnyLogic ??? ???? 13?? ????? ??? ??? 9?? ?? ?? ? ?? ???? ?? ??? ???? ?? ??? ????. ??? AnyLogic ??? Personal Edition?? ? ????? ?????? ?? ? ??? ?? ????. ??? ? ????? ?? ???? ???? ???? ??????? ???? ?? ?? ???? ?? ? ????, ?? ???? ????? ???? ?? ??? ????.Figure SEQ Figure \* ARABIC 1. 4? ????? ?? ??? ? ?? ?? ??2 Method2.1 AnyLogic ModelAnyLogic? Simulation Modeling Software??, ??? ??? ?????? ??? ?? ??? ?? ? ?? ???????. ? ????? Main? ??? ????, Simulation? ?? 4? ????? ??? ??? ???? ??? ?? ??? ??? ? ??? ???. ?? AnyLogic University version?? ???? Sensitivity Analysis? ???? ?? ????? ?? ??? ????? ????? ? Delayed time per car? ???? ? ??. ?? ??? ??? ??? ??? ??? ?? ????? ?? ?????? ??? ? ??. ??? ??? ??? Main Agent, Car Agent, Simulation, Sensitivity Analysis 1, 2? ???? ??. ??? ???? Simulation, Sensitivity Analysis 1, 2? Simulation Scenarios? ???? ?????.2.1.1 MainMain? ??? ??? ?? Simulation, Logic, Parameter, Statistics?? ??? ??.Figure SEQ Figure \* ARABIC 2 Simulation?Simulation ??? Simulation? ????? ???? ??? ????. ????? ?? 4? ???? ????? ???, ???? ??? ????, ??? ?? ?? ???? ? ???? ???? ?? ????. ??? ? ??? ?? 4????, ?? 3.5m, ???? ??? ?? 8?? ?? ??. ?? ???? ? ??? ??? ????? ?? ? ??? ?? ? ?? ?? ??? ??? ? ???? ?? ?? ????. ?? ????? ?? ??? ???? ????? ? ??????? ???, ????? ????? ?? ??? ???? ???? ???? ??? ??? ? ?? ??? ????? ???? ??.Figure SEQ Figure \* ARABIC 3 Logic ??? ??? ??, ???? ???? ????, parameter??? ?? ??? ? ??? ?? ???, ??, ??? ? ??? ??? ??? ? ??. roadNetworkDescriptor? ?? ??? ???? ? ??? ??? ????.Figure SEQ Figure \* ARABIC 4 Parameter ??? ?, ??, ?? ?? ? ?????? ??? ???? ?? ???? ?? ?? ? ???? ?? ??? ???? ?? ????. Cal_Lambda, Cal_Yellow, updateTrafficLight? ??? ??????? ??? ?? ??? ??? ?? ???? ?????, onVehicleArrived? ? ??? ??? ???? ??? ???? ???? ?? ?? ????.trafficLight 1~9? 9?? ? ????? ????. ? ???? ???? lane connector? ???? ???, ???, ???? ??? ????? ??? ? ??. ??? ? ??? ??? ?????? ????. Data Set ? DS? ?? ?? ? ?? ? ?? ???? ???? ????? ?? ? ???? ? ? ??? ???.Figure SEQ Figure \* ARABIC 5 Statistics ?Cars in system, Stops count per car, Average speed, Average time in system, Delayed time per car? ???? ???? ????. ?? Delayed time per car? 10??? ???? ?????? 1440?? sample? ?????, ?? ??? simulation? ??? ? ?? 4??? ??? ???? ????.2.1.2 Simulation Scenarios???? ?????? ???? ???? ???? ???? ?? ? ?? ? ?? ??? ?, ??? ??? ? ?????? ?? ????? ??? ??? ??. ??? ?? ??? ??? ?? ?? ??? ? ?? ?? ?? ???? ??? ??? ???? ? ??? ??? ?? ???? ??. ?? ??? ?? ??? ?? ???? ??? ????? ??? ?? ??? ?? ???? 300 cars per hour, ???? 150 cars per hour? ????. ??? ??? ? ??? ??? ?? ?? ??? ??? ?? ????. ??? ??? ?? ?? ? ?? ??? ????.Table SEQ Table \* ARABIC 2 ??? ????? ?? ?????? ????? ????? ??? ?? ?? ??? ??0.40.30.3??? ?? ??0.80.10.1???? ?? ??0.10.80.1???? ?? ??0.10.10.8???? ?????, ??? ?? ???, ?? ??? ???? ?? ??? ?? ??? ????? ???? ???, ?? ????? ???? ????. ??? ? ?? ?? ??? ??? ?? ??? ?? ? ??? ??? ??? ????. ?, ?? ??? ???? ?, ?, ? ? ???? ?? ??? ?? ???? 4×4×4=64 ??? ??? ??.??, ????? ???? 4? ?????? 9? ?? ??? ????? ???? ??. ??? ?? ??? ?? ??? ?? ?????? ?? ??? ?? ??? ?? ??? ?? ?????? ?? ??? ??? ? ??? ????. ???? ??? ????? ??? ???? ???? ??? ?? 5?? ??? ????.?? ??? ???? ???? ??? ???? ???, ?? ??? ???? ???, ?? ??? ???? ???? ??? ???? ???? 5?? ??? ??? ?? ?? 64?? ?? ??? ??? ????? ????, ? 5×64=320 ??? ??? ?? ??. ??? ? 320?? ????? ???? ?????. ?? ?? ??? ?? ??? ??, AnyLogic? ?? Database ??? ???? ????. Parameter? default value? database reference ??? ?? Scenario_number ?? ?? ?? ?? ????? ??.2.1.3 ExperimentsExperiments? ??? parameter? ???? ?? ??? ????? ??? ? ? ??? ?? ????. ? ????? Simulation? Sensitivity Analysis? ????.2.1.3.1 Simulation??? ??? ??, 2D? 3D ??, ?? ??? ??? ??, ?? ??? ??? ??? Simulation? ?????. ??? ??? ?? Delayed time per car? ????? ?? ? ? ??? warm-up period? ??? ??? ? ??. ? ?? 1???? ?????. ?????? ???? ?? ??? ???? ??? ?? ? ???, ?? ??? ????? ?? ?? ???. ????? ?? ?? ???? ????? ?? ??? ???? ?? Fixed seed? ????, model? delayed time per car ?? ?????? ??? ??? 18000? ?? ???? ?????. ??? Simulation? ?? ?, ?? ????. Figure SEQ Figure \* ARABIC 6 Simulation ?? ?, ? ??2.1.3.2 Sensitivity Analysis 1?? ??? ????? ???? ?? ???? ?? ??? ???? ???? ???. ??? ??? ??? ??? ?? ???? ????? ???? ??? ??? ??. Sensitivity Analysis 1? ????? ?? ???? ?? ?? ??? ??? ??? ??? 9?? ?? ??? delayed time per car? ????, ?? ?? ??? ??? ?? ?? ?? ??? ??? ????? ???? experiments??. ?? university version??? ???? Sensitivity Analysis? ????.?? ?? ?? ?? ?? ?? ???? ? ??? variable? ????. Edit box? ?? ???? variable? ?? ????, ? ?? ???? parameter? ????. 9?? ?? ??? ??? delayed time per car? ??? ????? ??? ???? ????. Chandan et al. (2017) ??? replication? 10?? ??????, ? ????? ? ?? ??? ??? 7? ?????. ?? ?? 5 ~ 10?? ?????, ? ??? ??? ?? 7? ????? 10? ????? ? ??? ??? ????. ? ??? simulation? ????? 18000? ?? ????? ????.??? ?? ? output.xlsx ??? ???? delayed time per car mean ?? ??? ?? ?? ?? ??? ????, ? ??? ? ?? ?? ??? ????. ?? ???? ?? ??? ??? ??? ?? ??, ?? ?? ??, ?? ?? ?? ????. Sheet ??? ? ???? ???? ?? ???? mean, deviation sheet? ?? ????.Figure SEQ Figure \* ARABIC 7 Sensitivity Anaylsis 1 ?? ??2.1.3.3 Sensitivity Analysis 2Sensitivity Analysis 1? ????? university edition??? ???? Sensitivity Analysis? ??? ????. 1?? 320?? ???? ?? ????? ???? ??? ?? ??? ?? ? ????? ?? ???? ???? ????. ? ????? 9?? ?? ??? ?? ??? ?? ??? ?? ??? ?? 9?? plot???? ???? ???. ?? ??? ??? ???? ?? ? ?????? 9?? ????? ????? ?? ????.Figure SEQ Figure \* ARABIC 8 Sensitivity Analysis 2 ?? ??3 Results???? 9?? ?? ?? ??? ??? ?? ? ??? ??? ?? ?? ???? ???? ??? ???? ??. ??? ???? ???? ???? ???? ??? ? ?? ??? ??? ?? ??? ???? ? ? ??.Table SEQ Table \* ARABIC 4 ??? ?? ?? ?? ????? ???? ? ???? ???? ??? ??(?? ????)??? ??? ???? ????, ??? ?? ??? ???? ???? ?? ?????? ?? ???(?? ????)??? ???? ??? ???? ?? ?? ??? ?????? ??? ? ??, ? ? ????? ??? ???? ??? ?????? ?? ?? ??? ??? ? ???? ????? ????? ??? ???? ??? ?? ???? ??? ??, ?? ????? ??? ???? ??? ?? ??? ?? ???3.1 ??? ??? ???? ??? ???? ??? ??? ???? ????? ?? ??? ?? ?? ??? ?? ??? ??? ??? ???? ??? ???. ?? ???? 6, 11, 22, 28, 43, 59, 75, 86, 107, 123, 155, 166, 171, 182, 187, 203, 219, 224, 256, 267, 310 ??? ??? ? ???, Figure 9? ???? 11? 27? ????.Figure SEQ Figure \* ARABIC 9 Scenario11 and Scenario 27?? ??? ??? ???? ??? ??? ??? ???? ??? ??? ?? ?????? ???, ?? ?? ??? ???? ???? ???? ?? ??? ??? ???? ????? ???. ???? 10, 19, 83, 97, 215, 239, 300 ?? ?? ???? Figure 10? ???? 19, 84? ????.Figure SEQ Figure \* ARABIC 10 Scenario 19 and Scenario 83????? ??? ?? ??? ???? ???? ??? ?? ??? ??? ????? ??? ??? ??? ???? ?????? ??? ?? ??? ??? ???? ?? ??? ? ???? ??? ???. ?, ??? ???? ????? ?? ??? ??? ????? ??. ??? ???? ???? 64, 80, 104, 112, 126 ??? ??? ? ??. Figure 11? ???? 64? 80? ????.Figure SEQ Figure \* ARABIC 11 Scenario 64 and Scenario 803.2 ??? ???? ??? ??? ??? ??? ??? ? ?? ??? ???? ??? ??? 4? ????? ?? 4???? ??? ?? ??? ??? ??? ?? ???? ??? ???? ??. ??? ??? ?? ??? ??? ?? ??? ??. ??? ???? ?? ?? ? ???? ???? ?? ??? ?? ??? ??? ???? ?????, ???? ???? 7, 9, 48 ?? ???? ???? ??? ?? ???. ? ??? ???? 23, 35, 42, 143, 147, 232, 313?? ??. ???? ?? ?? ??? ??? ??? ??? ?? ???? ?? ???? ??? ? ? ??, Figure 12? ???? 23? 35??.Figure SEQ Figure \* ARABIC 12 Scenario 23 and Scenario 353.3 ? ????? ??? ???? ??? ?????? ?? ?? ??? ??? ?????? ?????? ?? ???? ???? ??? ?? ??? ??? ??????. ???? 1, 2, 4, 13, 17, 45, 49, 50, 65, 81, 84 ? ??? ?? ??? ??? ???? ?? delayed time per car ?? ? ???. ??? ???? 257, 273 ???? ? ???? ??? ???? ?????? ?? ?? ??? ???? ???? ?? ??? ??? ? ?????? ???? ???. Figure 13? ???? 257? 273??.Figure SEQ Figure \* ARABIC 13 Scenario 257 and Scenario 2733.4 ??? ??? ???? ??? ?? ???? ??? ?? ? ???? ? ?? ??? ?? ?? ? ??. ???? ??? ??? ?? ????? ?? ??? ???? ??? ??????? ?? ???, ??? ?? ?? ?? ?? ?????? ? ?? ??? ???? 1~4 ?? ???? ?? ?? ??? ???? 5~8?? ??, ??? ?? ?? ??? ???? 9?? ??? ? ?? delayed time per car? ????. ??? ?? ?? ??? ???? ?? ?? ? ??? ?? ?? ??? ? ?? ??? ???? ??? ????, ???? 7, 10, 15, 71, 204, 247 ?? ?? ????. Figure 14? ???? 10, 71??.Figure SEQ Figure \* ARABIC 14 Scenario 10 and Scenario 714 Conclusion??? ??? ???? ???? ?????? ???? ???? ??? ???? ??? ?????. ?? ??? ?? ???? ?? ??? ???? ?? ??? ???? ??? ?? ??? ???? ??? ???? ??? ??? ?? ??? ? ???. ? ?? ??? ???? ?????? ?? ?, ?? ?? ??? ???? ?????? ? ? ????? ???? ????. ??? ????? ? ?? ??? ??? ?? ??? ?? ?? ?? ??? ?? ? ? ??.???? ?? ??? ??, ??? ?? ??? ??, ?? ??? ?? ???? ? ?? ??? ???? ??. ??? ?? ?? ??? ???? ? ?????? ??? ?? ??? ?? ??? ?? ??, ???? ?? ????? ?? ???? ??? ??? ?? ?? ??? ? ? ???. ??? ???? ?? ??? ?? ???? ??? ?? ???? ?? ???, ?? ????? ??? ??? ? ??? ??? ????.??, ??? ???? ?? ? ?? ?, ?? ?? ??? ???? ?????? ??? ?? ?? ???? ?? ??? ??? ??. ??? ?? ??? ???? ???? ???, ?? Sensitivity Analysis?? ?? ?, ?? ?? ??? ???? ?? ??? ?? ??? ??? ???? ?? deviation? ?? ??? ??? ????. ???? ??? ???? ???? ??? ? ?? ???, ???? ??? ?? ??? ?? ??? ??? ??? ????. ?? ????? ??? ??? ?? ?? ??? ?? ??? ???? ?? ??? ??? ??? ??? ?? ??? ?? ???.4? ???? ?? 4??? ??? ???? ???? ?????? ???? ? ????, ?? ??? ?? ??? ?? ?????? ?? ????? ???? ?????? ? ???? ???? ???? ??? ??? ???. ??? ?? 4? ????? ?? ???? ?? ??? ???? ??? ??? ??? ??? ? ???? ?? ??? ?? ??? ??? ???? ? ? ??.Review?? ?? ? ? ?? ??? ? ??? ?????? ??? ????? ???? ? ???. ?? ?????? ? ?, ? ? ? ?? ??? ????? ?? ?? ????? ??? ?????? ??? ??? ???? ?? ???, ??? ?? ?? ?? ???? ????? ?? ?? ??? ????. ????? ??? ??? ?? ?? ??? ?? ??? ? ??. ???? ????? ???? ?? ?? ???? ???????? ??? ??? ? ????? ? ?????. AnyLogic??? ?? ?? ???? ? ??? ?????? ?? ?? ??? ?? ? ???. ?? ?? ?? ????, ??? ???? ??? ?? ??? ?? ??? ??? ?? ??? ???? ????? ???? ?? ?? ???. ??? ??? ????? ?? ?? ???? ? ? ? ?? ??? ?? ???? ?? ? ??. ??, ???? ?? ??? ??? ?? ??? ??? ???? ????. ? ???? ???? ?? ??? ?? ??? ??? ??? ? ???, ??? ??? ????? ? ? ??? ??? ?? ? ?? ?? ??? ???.??? ??? ???? ??? ???? ?? ?? ???? ??? ?? ?? ???? ??????, ?? ??? ?? ??? ???? ? ?? ??? ??? ??? ? ???. ???? ???? ?? ??? ??? ??? ??? ?? ?? ???? ????? ?? ???? ?? ???.????? ??? ??? ??? ????? ??? ????, ??? ??? ????? ??? ??? ??? ?? ??? ??? ?? ??? ??? ???? ??? ???? ?? ?????? ?? ??? ??.ReferencesChandan, K., Seco, A. M., & Silva, A. B. (2017). Real-time Traffic Signal Control for Isolated Intersection, using Car-following Logic under Connected Vehicle Environment.?Transportation research procedia,?25, 1610-1625.Koonce, P., & Rodegerdts, L. (2008).?Traffic signal timing manual (No. FHWA-HOP-08-024). United States. Federal Highway Administration.AppendixAnyLogic ??? ??? ???? ??? ??.Cal_Lambdaint total = xn + xs + xw + xe;if(trafficIndex == 1){lambda1 = Math.max((xn*Pne+xn*Pnw) / (1980*road_N.getForwardLanesCount()), (xs*Psw+xs*Pse) / (1980*road_S.getForwardLanesCount()));lambda2 = Math.max((xn*Pns+xn*Pnw) / (2200*road_N.getForwardLanesCount()), (xs*Psn+xs*Pse) / (2200*road_S.getForwardLanesCount()));lambda3 = Math.max((xe*Pes+xe*Pen) / (1980*road_E.getForwardLanesCount()), (xw*Pwn+xw*Pws) / (1980*road_W.getForwardLanesCount()));lambda4 = Math.max((xe*Pew+xe*Pen) / (2200*road_E.getForwardLanesCount()), (xw*Pwe+xw*Pws) / (2200*road_W.getForwardLanesCount()));lambda5 = 0;lambda6 = 0;if(Pne > 0.5 || Psw > 0.5) min1 = 15;else min2 = 15;if(Pwn > 0.5 || Pes > 0.5) min3 = 15;else min4 = 15;}else if(trafficIndex == 2){lambda1 = Math.max((xn*Pne+xn*Pnw) / 3960, (xs*Psw+xs*Pse) / 3960);lambda2 = Math.max((xn*Pns+xn*Pnw) / 4400, (xs*Psn+xs*Pse) / 4400);lambda3 = (xw*Pwe+xw*Pws+xw*Pwn) / 4400;lambda4 = (xe*Pew+xe*Pen+xe*Pes) / 4400;lambda5 = 0;lambda6 = 0;if(Pne > 0.5 || Psw > 0.5) min1 = 15;else min2 = 15;min3 = 15;min4 = 15;}else if(trafficIndex == 3){lambda1 = (xs*Psn+xs*Psw+xs*Pse)/4400;lambda2 = (xn*Pns+xn*Pne+xn*Pnw)/4400;lambda3 = Math.max((xe*Pes+xe*Pen) / 3960, (xw*Pwn+xw*Pws) / 3960);lambda4 = Math.max((xe*Pew+xe*Pen) / 4400, (xw*Pwe+xw*Pws) / 4400);lambda5 = 0;lambda6 = 0;min1 = 15;min2 = 15;if(Pwn > 0.5 || Pes > 0.5) min3 = 15;else min4 = 15;}else if(trafficIndex == 4){lambda1 = (xs*Psn+xs*Psw+xs*Pse) / 4400;lambda2 = (xn*Pns+xn*Pne+xn*Pnw) / 4400;lambda3 = (xw*Pwe+xw*Pws+xw*Pwn) / 4400;lambda4 = (xe*Pew+xe*Pen+xe*Pes) / 4400;lambda5 = 0;lambda6 = 0;min1 = 15;min2 = 15;min3 = 15;min4 = 15;}else if(trafficIndex == 5){lambda1 = Math.max((xn*Pne+xn*Pnw) / 3960, (xs*Psw+xs*Pse) / 3960);lambda2 = Math.max((xn*Pns+xn*Pnw) / 4400, (xs*Psn+xs*Pse) / 4400);lambda3 = (xw*Pwe+xw*Pws+xw*Pwn) / 4400;lambda4 = Math.max((xe*Pew+xe*Pen) / 4400, (xw*Pwe+xw*Pws) / 4400);lambda5 = (xe*Pew+xe*Pen+xe*Pes) / 4400;lambda6 = 0;if(Pne > 0.5 || Psw > 0.5) min1 = 15;else min2 = 15;if(Pwn > 0.5) min3 = 15;else min4 = 15;if(Pes > 0.5) min5 = 15;else min4 = 15;}else if(trafficIndex == 6){lambda1 = (xs*Psn+xs*Psw+xs*Pse)/4400;lambda2 = (xn*Pns+xn*Pne+xn*Pnw)/4400;lambda3 = (xw*Pwe+xw*Pws+xw*Pwn) / 4400;lambda4 = Math.max((xe*Pew+xe*Pen) / 4400, (xw*Pwe+xw*Pws) / 4400);lambda5 = (xe*Pew+xe*Pen+xe*Pes) / 4400;lambda6 = 0;min1 = 15;min2 = 15;if(Pwn > 0.5) min3 = 15;else min4 = 15;if(Pes > 0.5) min5 = 15;else min4 = 15;}else if(trafficIndex == 7){lambda1 = (xs*Psn+xs*Psw+xs*Pse)/4400;lambda2 = Math.max((xn*Pns+xn*Pnw) / 4400, (xs*Psn+xs*Pse) / 4400);lambda3 = (xn*Pns+xn*Pne+xn*Pnw)/4400;lambda4 = Math.max((xe*Pes+xe*Pen) / 3960, (xw*Pwn+xw*Pws) / 3960);lambda5 = Math.max((xe*Pew+xe*Pen) / 4400, (xw*Pwe+xw*Pws) / 4400);lambda6 = 0;if(Psw > 0.5) min1 = 15;else min2 = 15;if(Pne > 0.5) min3 = 15;else min2 = 15;if(Pwn > 0.5 || Pes > 0.5) min4 = 15;else min5 = 15;}else if(trafficIndex == 8){lambda1 = (xs*Psn+xs*Psw+xs*Pse)/4400;lambda2 = Math.max((xn*Pns+xn*Pnw) / 4400, (xs*Psn+xs*Pse) / 4400);lambda3 = (xn*Pns+xn*Pne+xn*Pnw)/4400;lambda4 = (xw*Pwe+xw*Pws+xw*Pwn) / 4400;lambda5 = (xe*Pew+xe*Pen+xe*Pes) / 4400;lambda6 = 0;if(Psw > 0.5) min1 = 15;else min2 = 15;if(Pne > 0.5) min3 = 15;else min2 = 15;min4 = 15;min5 = 15;}else if(trafficIndex == 9){lambda1 = (xs*Psn+xs*Psw+xs*Pse)/4400;lambda2 = Math.max((xn*Pns+xn*Pnw) / 4400, (xs*Psn+xs*Pse) / 4400);lambda3 = (xn*Pns+xn*Pne+xn*Pnw)/4400;lambda4 = (xw*Pwe+xw*Pws+xw*Pwn) / 4400;lambda5 = Math.max((xe*Pew+xe*Pen) / 4400, (xw*Pwe+xw*Pws) / 4400);lambda6 = (xe*Pew+xe*Pen+xe*Pes) / 4400;if(Psw > 0.5) min1 = 15;else min2 = 15;if(Pne > 0.5) min3 = 15;else min2 = 15;if(Pwn > 0.5) min4 = 15;else min5 = 15;if(Pes > 0.5) min6 = 15;else min5 = 15;}lambdaSum = lambda1 + lambda2 + lambda3 + lambda4 + lambda5 + lambda6;Cal_Yellowdouble yellow = 1+approachingVelocity/10+(roadNetwork.getLaneWidth()*3+carLength)/approachingVelocity-1.5;if (yellow>5) return 5;else return yellow;updateTrafficLightchooseTrafficLight(trafficIndex);//Calculate Yellow length Yellow = Cal_Yellow(speed);//Calculate LambdaCal_Lambda(trafficIndex);//Calculate Cycle lengthif(trafficIndex == 1){CycleLength = (1.5*4*Yellow+5)/(1-lambdaSum);R_cycle = CycleLength - 4 * Yellow;cycle1 = R_cycle*(lambda1/lambdaSum);cycle2 = R_cycle*(lambda2/lambdaSum);cycle3 = R_cycle*(lambda3/lambdaSum);cycle4 = R_cycle*(lambda4/lambdaSum);cycle5 = 0;cycle6 = 0;while(cycle1 < min1 || cycle2 < min2 || cycle3 < min3 || cycle4 < min4){CycleLength += 5;R_cycle = CycleLength - 4 * Yellow;cycle1 = R_cycle*(lambda1/lambdaSum);cycle2 = R_cycle*(lambda2/lambdaSum);cycle3 = R_cycle*(lambda3/lambdaSum);cycle4 = R_cycle*(lambda4/lambdaSum);}}else if(trafficIndex == 2){CycleLength = (1.5*4*Yellow+5)/(1-lambdaSum);R_cycle = CycleLength - 4 * Yellow;cycle1 = R_cycle*(lambda1/lambdaSum);cycle2 = R_cycle*(lambda2/lambdaSum);cycle3 = R_cycle*(lambda3/lambdaSum);cycle4 = R_cycle*(lambda4/lambdaSum);cycle5 = 0;cycle6 = 0;while(cycle1 < min1 || cycle2 < min2 || cycle3 < min3 || cycle4 < min4){CycleLength += 5;R_cycle = CycleLength - 4 * Yellow;cycle1 = R_cycle*(lambda1/lambdaSum);cycle2 = R_cycle*(lambda2/lambdaSum);cycle3 = R_cycle*(lambda3/lambdaSum);cycle4 = R_cycle*(lambda4/lambdaSum);}}else if(trafficIndex == 3){CycleLength = (1.5*4*Yellow+5)/(1-lambdaSum);R_cycle = CycleLength - 4 * Yellow;cycle1 = R_cycle*(lambda1/lambdaSum);cycle2 = R_cycle*(lambda2/lambdaSum);cycle3 = R_cycle*(lambda3/lambdaSum);cycle4 = R_cycle*(lambda4/lambdaSum);cycle5 = 0;cycle6 = 0;while(cycle1 < min1 || cycle2 < min2 || cycle3 < min3 || cycle4 < min4){CycleLength += 5;R_cycle = CycleLength - 4 * Yellow;cycle1 = R_cycle*(lambda1/lambdaSum);cycle2 = R_cycle*(lambda2/lambdaSum);cycle3 = R_cycle*(lambda3/lambdaSum);cycle4 = R_cycle*(lambda4/lambdaSum);}}else if(trafficIndex == 4){CycleLength = (1.5*4*Yellow+5)/(1-lambdaSum);R_cycle = CycleLength - 4 * Yellow;cycle1 = R_cycle*(lambda1/lambdaSum);cycle2 = R_cycle*(lambda2/lambdaSum);cycle3 = R_cycle*(lambda3/lambdaSum);cycle4 = R_cycle*(lambda4/lambdaSum);cycle5 = 0;cycle6 = 0;while(cycle1 < min1 || cycle2 < min2 || cycle3 < min3 || cycle4 < min4){CycleLength += 5;R_cycle = CycleLength - 4 * Yellow;cycle1 = R_cycle*(lambda1/lambdaSum);cycle2 = R_cycle*(lambda2/lambdaSum);cycle3 = R_cycle*(lambda3/lambdaSum);cycle4 = R_cycle*(lambda4/lambdaSum);}}else if(trafficIndex == 5){CycleLength = (1.5*5*Yellow+5)/(1-lambdaSum);R_cycle = CycleLength - 5 * Yellow;cycle1 = R_cycle*(lambda1/lambdaSum);cycle2 = R_cycle*(lambda2/lambdaSum);cycle3 = R_cycle*(lambda3/lambdaSum);cycle4 = R_cycle*(lambda4/lambdaSum);cycle5 = R_cycle*(lambda5/lambdaSum);cycle6 = 0;while(cycle1 < min1 || cycle2 < min2 || cycle3 < min3 || cycle4 < min4 || cycle5 < min5){CycleLength += 5;R_cycle = CycleLength - 4 * Yellow;cycle1 = R_cycle*(lambda1/lambdaSum);cycle2 = R_cycle*(lambda2/lambdaSum);cycle3 = R_cycle*(lambda3/lambdaSum);cycle4 = R_cycle*(lambda4/lambdaSum);cycle5 = R_cycle*(lambda5/lambdaSum);}}else if(trafficIndex == 6){CycleLength = (1.5*5*Yellow+5)/(1-lambdaSum);R_cycle = CycleLength - 5 * Yellow;cycle1 = R_cycle*(lambda1/lambdaSum);cycle2 = R_cycle*(lambda2/lambdaSum);cycle3 = R_cycle*(lambda3/lambdaSum);cycle4 = R_cycle*(lambda4/lambdaSum);cycle5 = R_cycle*(lambda5/lambdaSum);cycle6 = 0;while(cycle1 < min1 || cycle2 < min2 || cycle3 < min3 || cycle4 < min4 || cycle5 < min5){CycleLength += 5;R_cycle = CycleLength - 4 * Yellow;cycle1 = R_cycle*(lambda1/lambdaSum);cycle2 = R_cycle*(lambda2/lambdaSum);cycle3 = R_cycle*(lambda3/lambdaSum);cycle4 = R_cycle*(lambda4/lambdaSum);cycle5 = R_cycle*(lambda5/lambdaSum);}}else if(trafficIndex == 7){CycleLength = (1.5*5*Yellow+5)/(1-lambdaSum);R_cycle = CycleLength - 5 * Yellow;cycle1 = R_cycle*(lambda1/lambdaSum);cycle2 = R_cycle*(lambda2/lambdaSum);cycle3 = R_cycle*(lambda3/lambdaSum);cycle4 = R_cycle*(lambda4/lambdaSum);cycle5 = R_cycle*(lambda5/lambdaSum);cycle6 = 0;while(cycle1 < min1 || cycle2 < min2 || cycle3 < min3 || cycle4 < min4 || cycle5 < min5){CycleLength += 5;R_cycle = CycleLength - 4 * Yellow;cycle1 = R_cycle*(lambda1/lambdaSum);cycle2 = R_cycle*(lambda2/lambdaSum);cycle3 = R_cycle*(lambda3/lambdaSum);cycle4 = R_cycle*(lambda4/lambdaSum);cycle5 = R_cycle*(lambda5/lambdaSum);}}else if(trafficIndex == 8){CycleLength = (1.5*5*Yellow+5)/(1-lambdaSum);R_cycle = CycleLength - 5 * Yellow;cycle1 = R_cycle*(lambda1/lambdaSum);cycle2 = R_cycle*(lambda2/lambdaSum);cycle3 = R_cycle*(lambda3/lambdaSum);cycle4 = R_cycle*(lambda4/lambdaSum);cycle5 = R_cycle*(lambda5/lambdaSum);cycle6 = 0;while(cycle1 < min1 || cycle2 < min2 || cycle3 < min3 || cycle4 < min4 || cycle5 < min5){CycleLength += 5;R_cycle = CycleLength - 4 * Yellow;cycle1 = R_cycle*(lambda1/lambdaSum);cycle2 = R_cycle*(lambda2/lambdaSum);cycle3 = R_cycle*(lambda3/lambdaSum);cycle4 = R_cycle*(lambda4/lambdaSum);cycle5 = R_cycle*(lambda5/lambdaSum);}}else if (trafficIndex == 9){CycleLength = (1.5*6*Yellow+5)/(1-lambdaSum);R_cycle = CycleLength - 6 * Yellow;cycle1 = R_cycle*(lambda1/lambdaSum);cycle2 = R_cycle*(lambda2/lambdaSum);cycle3 = R_cycle*(lambda3/lambdaSum);cycle4 = R_cycle*(lambda4/lambdaSum);cycle5 = R_cycle*(lambda5/lambdaSum);cycle6 = R_cycle*(lambda6/lambdaSum);while(cycle1 < min1 || cycle2 < min2 || cycle3 < min3 || cycle4 < min4 || cycle5 < min5 || cycle6 < min6){CycleLength += 5;R_cycle = CycleLength - 4 * Yellow;cycle1 = R_cycle*(lambda1/lambdaSum);cycle2 = R_cycle*(lambda2/lambdaSum);cycle3 = R_cycle*(lambda3/lambdaSum);cycle4 = R_cycle*(lambda4/lambdaSum);cycle5 = R_cycle*(lambda5/lambdaSum);cycle6 = R_cycle*(lambda6/lambdaSum);}}onVehicleArriveddouble timeInSystem = time() - v.startTime;timeInSystemDS.add( timeInSystem );double speedAtKph = v.getDistanceDriven( KILOMETER ) / toTimeUnits( timeInSystem, HOUR );speedDS.add( speedAtKph );long disposedCarCount = carDispose.count();carStopsDS.add( ( disposedCarCount == 0 ) ? 0 : carStopsCounter / (double)disposedCarCount );double delayedTime = v.delayTime;carStopsTimeDS.add( delayedTime );/* ??? ????? ?? ??? ??if(disposedCarCount % 500 == 0){// ?? 500?? ?? ?? ??? ??? ?? ????approachingVelocity = approachingVelocity / 500;updateTrafficLight();approachingVelocity = 0;}*///carStopsTimeDS.add( ( disposedCarCount == 0 ) ? 0 : carStopsTime / (double)disposedCarCount );Sensitivity Analysis 1? ??? ??? ??? ??.Imports sectionimport java.io.*;import java.io.FileOutputStream;import org.apache.poi.xssf.usermodel.XSSFCell;import org.apache.poi.xssf.usermodel.XSSFRow;import org.apache.poi.xssf.usermodel.XSSFSheet;import org.apache.poi.xssf.usermodel.XSSFWorkbook;After experimentint min_index = 0;double min_mean = mean_arr[0];for(int i = 1; i < 9; i++){if(min_mean > mean_arr[i]){min_mean = mean_arr[i];min_index = i;}}try{ XSSFRow row;XSSFCell cell;XSSFWorkbook workbook = new XSSFWorkbook();XSSFSheet sheet1 = workbook.createSheet("Result");XSSFSheet sheet2 = workbook.createSheet("Mean");XSSFSheet sheet3 = workbook.createSheet("Deviation");// ?? ???? replication ?? ???min_mean = min_mean / 7;//?? row ??row = sheet1.createRow(0);//?? cell ??row.createCell(0).setCellValue("Index of Min Traffic Light");row.createCell(1).setCellValue(min_index + 1);//?? row ??row = sheet1.createRow(1);//?? cell ??row.createCell(0).setCellValue("Mean of Delayed Time");row.createCell(1).setCellValue(min_mean);//?? row ??row = sheet1.createRow(2);//?? cell ??row.createCell(0).setCellValue("Elapsed Time");row.createCell(1).setCellValue(getRunTimeSeconds());// main?? ?? ?? ????? ????? yellow? ?? 3.1??? ??? ? ? ??double yellow = 3.1;updateTrafficLight(min_index+1, yellow);//?? row ??row = sheet1.createRow(4);//?? cell ??row.createCell(0).setCellValue("cycle1");row.createCell(1).setCellValue("cycle2");row.createCell(2).setCellValue("cycle3");row.createCell(3).setCellValue("cycle4");row.createCell(4).setCellValue("cycle5");row.createCell(5).setCellValue("cycle6");row.createCell(7).setCellValue("yellow");//?? row ??row = sheet1.createRow(5);//?? cell ??row.createCell(0).setCellValue(cycle1);row.createCell(1).setCellValue(cycle2);row.createCell(2).setCellValue(cycle3);row.createCell(3).setCellValue(cycle4);row.createCell(4).setCellValue(cycle5);row.createCell(5).setCellValue(cycle6);row.createCell(7).setCellValue(yellow);//// Input ?? sheet? ??////?? row ??row = sheet1.createRow(7);//?? cell ??row.createCell(0).setCellValue("xn");row.createCell(1).setCellValue("xs");row.createCell(2).setCellValue("xw");row.createCell(3).setCellValue("xe");//?? row ??row = sheet1.createRow(8);//?? cell ??row.createCell(0).setCellValue(xn_);row.createCell(1).setCellValue(xs_);row.createCell(2).setCellValue(xw_);row.createCell(3).setCellValue(xe_);//?? row ??row = sheet1.createRow(10);//?? cell ??row.createCell(0).setCellValue("Pns");row.createCell(1).setCellValue("Pne");row.createCell(2).setCellValue("Pnw");row.createCell(3).setCellValue("Psn");row.createCell(4).setCellValue("Psw");row.createCell(5).setCellValue("Pse");row.createCell(6).setCellValue("Pwe");row.createCell(7).setCellValue("Pwn");row.createCell(8).setCellValue("Pws");row.createCell(9).setCellValue("Pew");row.createCell(10).setCellValue("Pes");row.createCell(11).setCellValue("Pen");//?? row ??row = sheet1.createRow(11);//?? cell ??row.createCell(0).setCellValue(Pns_);row.createCell(1).setCellValue(Pne_);row.createCell(2).setCellValue(Pnw_);row.createCell(3).setCellValue(Psn_);row.createCell(4).setCellValue(Psw_);row.createCell(5).setCellValue(Pse_);row.createCell(6).setCellValue(Pwe_);row.createCell(7).setCellValue(Pwn_);row.createCell(8).setCellValue(Pws_);row.createCell(9).setCellValue(Pew_);row.createCell(10).setCellValue(Pes_);row.createCell(11).setCellValue(Pen_);// Mean Sheet ??String[] mean_data = chart0_dataSet.toString().split("\t|\n", -1);for(int i = 0; i < mean_data.length - 1; i = i + 2){row = sheet2.createRow(i / 2);row.createCell(0).setCellValue(mean_data[i]);row.createCell(1).setCellValue(mean_data[i+1]);}// Deviation Sheet ??String[] deviation_data = chart1_dataSet.toString().split("\t|\n", -1);for(int i = 0; i < deviation_data.length - 1; i = i + 2){row = sheet3.createRow(i / 2);row.createCell(0).setCellValue(deviation_data[i]);row.createCell(1).setCellValue(deviation_data[i+1]);}// ?? ?? ??? ??? ??FileOutputStream outFile;try {outFile = new FileOutputStream("output.xlsx");workbook.write(outFile);outFile.close();System.out.println("???? ??");} catch (Exception e) {e.printStackTrace();}} catch (Exception e){ traceln("Could not write to file."); }Sensitivity Analysis 2? ??? ?? 9?? ?? ??? 320?? ???? ??? ?? ?? ?? ?? ??? ??? ??? ??? ??.Visualize_output.py# 2019.01.25# This file visualize output files from Anylogicimport numpy as npimport osimport matplotlib.pyplot as pltimport pandas as pdimport xlrdfrom numpy.random import randnfrom pandas import Series, DataFramenp.random.seed(12345)plt.rc('figure', figsize=(10, 6))np.set_printoptions(precision=4)mean_arr = []deviation_arr = []for i in range(1, 10): mean_arr.append(pd.read_excel('trafficlight'+str(i)+'.xlsx', sheet_name=0, names=None).sort_index()) deviation_arr.append(pd.read_excel('trafficlight'+str(i)+'.xlsx', sheet_name=1).sort_index())mean = pd.concat(mean_arr, axis=1, ignore_index=True, keys=[1,2,3,4,5,6,7,8,9])deviation = pd.concat(deviation_arr, axis=1, ignore_index=True)mean.rename(columns=lambda x: x+1, inplace=True)deviation.rename(columns=lambda x: x+1, inplace=True)for i in range(1, 321): writer = pd.ExcelWriter('output/scenario'+str(i).zfill(2)+'.xlsx') mean[7*(i-1):7*i].to_excel(writer, 'Sheet1') deviation[7*(i-1):7*i].to_excel(writer, 'Sheet2') # ??1 ?? workbook = writer.book worksheet1 = writer.sheets['Sheet1'] chart1 = workbook.add_chart({'type': 'scatter'}) for j in range(1, 7): chart1.add_series({ 'categories': ['Sheet1', 0, 1, 0, 9], 'values': ['Sheet1', j, 1, j, 9], 'marker': {'type': 'circle'} }) chart1.set_title({'name': 'Delayed Time per Car Mean'}) chart1.set_x_axis({'name': 'Traffic Light Index'}) chart1.set_y_axis({'name': 'Delayed Time per Car(sec)'}) chart1.set_legend({'none': True}) # ??2 ?? worksheet2 = writer.sheets['Sheet2'] chart2 = workbook.add_chart({'type': 'scatter'}) for j in range(1, 7): chart2.add_series({ 'categories': ['Sheet2', 0, 1, 0, 9], 'values': ['Sheet2', j, 1, j, 9], 'marker': {'type': 'circle'} }) chart2.set_title({'name': 'Delayed Time per Car Deviation'}) chart2.set_x_axis({'name': 'Traffic Light Index'}) chart2.set_y_axis({'name': 'Delayed Time per Car(sec)'}) chart2.set_legend({'none': True}) worksheet1.insert_chart('A10', chart1) worksheet2.insert_chart('A10', chart2) writer.save() ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download