/* CIF SYSTEMDiagram */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Specific Geode Version @(V) tool=geodedit V4.0.0 format=SDL96 nested=yes cif=yes */ /* CIF Keep Specific Geode LastModified Mon May 20 16:22:26 2002 */ /* CIF Page 1 (2100, 2970) */ /* CIF Frame (40, 40), (1506, 2294) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (40, 40), (1640, 1880) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Preview 0 0 0 */ SYSTEM RailAvecRPC; /* CIF CurrentPage 1 */ /* CIF TEXT (101, 82), (1350, 2243) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEWTYPE ColorStop LITERALS Red, Green; OPERATORS ORDERING; ENDNEWTYPE ColorStop; NEWTYPE CGate LITERALS CloseGate, OpenGate; OPERATORS ORDERING; ENDNEWTYPE CGate; NewType TypeSituation LITERALS ExitTrainsPriority, TrainsPriority, OneTrainManyCarsGOpen, OneTrainFewCarsGOpen, OneTrainManyCarsGClose, OneTrainFewCarsGClose, NoTrainsGClose, NoTrainsGOpen OPERATORS ORDERING; ENDNEWTYPE TypeSituation; NEWTYPE TSpeed LITERALS slow, fast; OPERATORS ORDERING; ENDNEWTYPE TSpeed; SYNTYPE TypeTrackNumber = Integer CONSTANTS 0:4 /* Max Number of tracks */ ENDSYNTYPE TypeTrackNumber; SYNTYPE SpeedRank = Integer CONSTANTS 0:4 ENDSYNTYPE SpeedRank; SIGNAL InSensor (TSpeed), OutSensor (TSpeed); SIGNAL Ncars(Integer), QNcars; SIGNAL SColorStop(ColorStop), WhatColor; SIGNAL CmdGate(CGate), Initialize2; SIGNAL Initialize, ExitGate, GateStatus; SYNONYM MaxTracks = 1; SYNONYM MaxTrains = 2; /* max trains for track */ SYNONYM ExitStop = 0; /* gate position */ SYNONYM DistSecurity = 1; SYNONYM short =1; SYNONYM large = 2; SYNONYM t_limite = 4; SYNONYM DistanceSlow =8, DistanceFast = 15; SYNONYM SpeedSlow = 2, SpeedFast = 4; SYNONYM SafeSlowDistance = 4, SafeFastDistance = 11; SYNONYM CarsArrival = 5, CarsDepart = 10; SYNONYM CarsBorneSup = 50; Newtype T_Integer OPERATORS minimum : Integer, Integer -> Integer; maximum : Integer, Integer -> Integer; AXIOMS FOR ALL n1, n2 IN Integer ( maximum(n1, n2) == IF n1 > n2 THEN n1 ELSE n2 FI; minimum(n1, n2) == IF n1 > n2 THEN n2 ELSE n1 FI; ); ENDNEWTYPE T_Integer; /* CIF End Text */ /* CIF CurrentPage DefaultPartition */ /* CIF CHANNEL (1002, 914) , (366, 914) */ /* CIF TextPosition (568, 935) */ /* CIF TextPosition (397, 735) SignalList1 */ /* CIF TextPosition (813, 947) SignalList2 */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode TextMode 0 Siglist1 */ /* CIF Keep Specific Geode TextMode 0 Siglist2 */ /* CIF Keep Specific Geode Modified */ CHANNEL C_to_Track FROM Track VIA C_to_Track TO Controller WITH InSensor, OutSensor, Initialize; FROM Controller TO Track VIA C_to_Track WITH SColorStop; ENDCHANNEL; /* CIF CHANNEL (1002, 1240) , (366, 1240) */ /* CIF TextPosition (566, 1262) */ /* CIF TextPosition (403, 1172) SignalList1 */ /* CIF TextPosition (805, 1298) SignalList2 */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode TextMode 0 Siglist1 */ /* CIF Keep Specific Geode TextMode 0 Siglist2 */ /* CIF Keep Specific Geode Modified */ CHANNEL Ctr_to_Cars FROM GateCars TO Controller WITH NCars; FROM Controller TO GateCars WITH CmdGate, QNCars; ENDCHANNEL; /* CIF CurrentPage DefaultPartition */ /* CIF BlockType (1071, 1626), (200, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (29, 192), (1647, 1917) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Preview 0 0 0 */ BLOCK TYPE Tracks; /* CIF CurrentPage DefaultPartition */ /* CIF GATE (773, 192), (773, 92) */ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode TextMode 6 Siglist1 */ /* CIF Keep Specific Geode TextMode 6 Siglist2 */ /* CIF Keep Specific Geode Modified */ /* CIF TextPosition (814, 131) */ /* CIF TextPosition (536, 138) SignalList1 */ /* CIF TextPosition (804, 41) SignalList2 */ GATE C_to_Track IN WITH SColorStop; OUT WITH InSensor, OutSensor, Initialize; /* CIF CurrentPage DefaultPartition */ /* CIF TEXT (79, 1700), (620, 259) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ remote procedure RemoteTrainPosition; returns Integer; remote procedure RemoteTrainAfterYou; fpar PID; remote procedure RemoteExitTrainBeforeYou; /* CIF End Text */ /* CIF CurrentPage DefaultPartition */ /* CIF SIGNALROUTE (1043, 1286) , (1267, 1039) */ /* CIF TextPosition (1164, 1163) */ /* CIF TextPosition (1274, 1078) SignalList1 */ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode TextMode 6 Siglist1 */ /* CIF Keep Specific Geode TextMode 6 Siglist2 */ /* CIF Keep Specific Geode Modified */ SIGNALROUTE Tr_Sen FROM Train VIA Tr_Sen TO Sensor WITH OutSensor, InSensor; /* CIF SIGNALROUTE (222, 1023) , (491, 1286) */ /* CIF TextPosition (367, 1145) */ /* CIF TextPosition (482, 1224) SignalList1 */ /* CIF TextPosition (284, 1021) SignalList2 */ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode TextMode 6 Siglist1 */ /* CIF Keep Specific Geode TextMode 6 Siglist2 */ /* CIF Keep Specific Geode Modified */ SIGNALROUTE Stop_to_Train FROM StopTrain TO Train VIA Stop_to_Train WITH SColorStop; FROM Train VIA Stop_to_Train TO StopTrain WITH WhatColor; /* CIF CreateLine (1368, 1314) , (1160, 1319) */ /* CIF SIGNALROUTE (642, 547) , (231, 873) */ /* CIF TextPosition (447, 699) */ /* CIF TextPosition (324, 835) SignalList1 */ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode TextMode 6 Siglist1 */ /* CIF Keep Specific Geode TextMode 2 Siglist2 */ /* CIF Keep Specific Geode Modified */ SIGNALROUTE S_to_H FROM MessagesHandler TO StopTrain WITH SColorStop; /* CIF SIGNALROUTE (1253, 889) , (887, 547) */ /* CIF TextPosition (1110, 761) */ /* CIF TextPosition (794, 646) SignalList1 */ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode TextMode 6 Siglist1 */ /* CIF Keep Specific Geode TextMode 6 Siglist2 */ /* CIF Keep Specific Geode Modified */ SIGNALROUTE Out_to_Han FROM Sensor TO MessagesHandler WITH OutSensor, InSensor; /* CIF SIGNALROUTE (772, 465) , (773, 192) */ /* CIF TextPosition (782, 293) */ /* CIF TextPosition (584, 198) SignalList1 */ /* CIF TextPosition (782, 390) SignalList2 */ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode TextMode 6 Siglist1 */ /* CIF Keep Specific Geode TextMode 6 Siglist2 */ /* CIF Keep Specific Geode Modified */ SIGNALROUTE C_to_Track FROM MessagesHandler TO ENV VIA C_to_Track WITH InSensor, OutSensor, Initialize; FROM ENV VIA C_to_Track TO MessagesHandler WITH SColorStop; /* CIF SIGNALROUTE (1160, 1401) , (1368, 1401) */ /* CIF TextPosition (1188, 1368) */ /* CIF TextPosition (1242, 1438) SignalList1 */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode TextMode 2 Siglist1 */ /* CIF Keep Specific Geode TextMode 2 Siglist2 */ /* CIF Keep Specific Geode Modified */ SIGNALROUTE T_Sched FROM Train VIA T_Sched TO SchedTrains WITH ExitGate; /* CIF SIGNALROUTE (887, 509) , (1515, 509) , (1515, 1283) */ /* CIF TextPosition (1327, 457) */ /* CIF TextPosition (1525, 1209) SignalList1 */ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode TextMode 6 Siglist1 */ /* CIF Keep Specific Geode TextMode 2 Siglist2 */ /* CIF Keep Specific Geode Modified */ SIGNALROUTE Hand_to_Sched FROM MessagesHandler TO SchedTrains WITH Initialize2; /* CIF CurrentPage DefaultPartition */ /* CIF ProcessType (960, 1728), (437, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page 1 (2100, 2970) */ /* CIF Frame (20, 20), (1520, 1516) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (20, 20), (5142, 2145) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ PROCESS TYPE TypeTrains; FPAR TrainSpeed TSpeed, BeforeTrain PID, LongTrain Integer; /* CIF CurrentPage DefaultPartition */ /* CIF GATE (556, 2165), (556, 2265) */ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode TextMode 0 Siglist1 */ /* CIF Keep Specific Geode TextMode 0 Siglist2 */ /* CIF Keep Specific Geode Modified */ /* CIF TextPosition (354, 2215) */ /* CIF TextPosition (576, 2185) SignalList1 */ /* CIF TextPosition (576, 2285) SignalList2 */ GATE Stop_to_train IN WITH SColorStop; OUT WITH WhatColor; /* CIF GATE (1114, 2165), (1114, 2265) */ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode TextMode 0 Siglist1 */ /* CIF Keep Specific Geode TextMode 0 Siglist2 */ /* CIF Keep Specific Geode Modified */ /* CIF TextPosition (1006, 2215) */ /* CIF TextPosition (1134, 2285) SignalList1 */ GATE Tr_Sen OUT WITH OutSensor, InSensor; /* CIF GATE (1562, 2165), (1562, 2265) */ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode TextMode 0 Siglist1 */ /* CIF Keep Specific Geode TextMode 0 Siglist2 */ /* CIF Keep Specific Geode Modified */ /* CIF TextPosition (1547, 2215) */ /* CIF TextPosition (1582, 2285) SignalList1 */ GATE T_Sched OUT WITH ExitGate; /* CIF CurrentPage 1 */ /* CIF TEXT (43, 108), (1365, 1398) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DCL distance Integer; DCL speed SpeedRank; DCL ColorS ColorStop; DCL MaxSpeed SpeedRank; DCL SafeDistance Integer; DCL CanStop Boolean; DCL AfterTrain PID; synonym t1 = 1; synonym accelerate = 1; synonym slowdown = -1; timer t; imported procedure RemoteTrainPosition; returns Integer; imported procedure RemoteExitTrainBeforeYou; imported procedure RemoteTrainAfterYou; fpar PID; /* CIF End Text */ /* CIF CurrentPage DefaultPartition */ /* CIF PROCEDURE (42, 1739), (327, 113) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (20, 20), (1618, 2224) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ PROCEDURE EvaluateSpeed; /* CIF CurrentPage DefaultPartition */ /* CIF TEXT (54, 1948), (989, 200) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DCL DistanceStop Integer; /* CIF End Text */ /* CIF CurrentPage DefaultPartition */ /* CIF ProcedureStart (501, 193), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ START ; /* CIF TASK (261, 343), (679, 103) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK DistanceStop := ( (Speed * (Speed +1) ) / 2 ) + 2 /* CIF TEXTEXTENSION (1011, 334), (149, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified *//* Distance pour arreter le train */ /* CIF End TEXTEXTENSION */; /* CIF DECISION (319, 484), (564, 125) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION Distance - DistanceStop > 0; /* CIF ANSWER */ /* CIF Specific Geode Position (377, 639), (150, 60) */ /* CIF Line (601, 609), (601, 624), (452, 624), (452, 639) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF TASK (315, 729), (273, 100) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK CanStop := true; /* CIF RETURN (352, 859), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF ANSWER */ /* CIF Specific Geode Position (676, 639), (150, 60) */ /* CIF Line (601, 609), (601, 624), (751, 624), (751, 639) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF TASK (609, 729), (285, 100) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK CanStop := false; /* CIF RETURN (651, 859), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF End DECISION */ ENDDECISION; ENDPROCEDURE; /* CIF PROCEDURE (53, 1882), (324, 113) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (20, 20), (3400, 2232) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ PROCEDURE ActualizeSpeed; FPAR acc Integer; /* CIF CurrentPage DefaultPartition */ /* CIF TEXT (40, 168), (578, 147) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DCL DistanceStop Integer; DCL FDistance Integer; DCL DistStopPlusT, DistTrains Integer; /* CIF End Text */ /* CIF CurrentPage DefaultPartition */ /* CIF ProcedureStart (703, 454), (200, 117) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ START ; /* CIF DECISION (634, 601), (338, 119) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION BeforeTrain = NULL; /* CIF ANSWER */ /* CIF Specific Geode Position (581, 750), (150, 60) */ /* CIF Line (803, 720), (803, 735), (656, 735), (656, 750) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF TASK (381, 840), (550, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK FDistance := call RemoteTrainPosition to BeforeTrain; /* CIF DECISION (526, 990), (259, 99) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION FDistance = 0; /* CIF ANSWER */ /* CIF Specific Geode Position (465, 1119), (150, 60) */ /* CIF Line (656, 1089), (656, 1104), (540, 1104), (540, 1119) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF TASK (395, 1209), (290, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK BeforeTrain := NULL; /* CIF ANSWER */ /* CIF Specific Geode Position (702, 1119), (150, 60) */ /* CIF Line (656, 1089), (656, 1104), (777, 1104), (777, 1119) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF End DECISION */ ENDDECISION; /* CIF ANSWER */ /* CIF Specific Geode Position (876, 750), (150, 60) */ /* CIF Line (803, 720), (803, 735), (951, 735), (951, 750) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF End DECISION */ ENDDECISION; /* CIF NEXTSTATE (703, 1358), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Continuation; /* CIF CurrentPage DefaultPartition */ /* CIF STATE (2615, 60), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Continuation; /* CIF INPUT (2609, 210), (211, 72) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT none; /* CIF DECISION (2523, 312), (384, 88) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION acc = accelerate; /* CIF ANSWER */ /* CIF Specific Geode Position (2274, 472), (150, 50) */ /* CIF Line (2715, 400), (2715, 415), (2349, 415), (2349, 472) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF TASK (2029, 552), (640, 109) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK DistanceStop := ( ( speed * (speed+1) ) / 2) +1, DistStopPlusT := (Speed +1)+ DistanceStop + DistSecurity; /* CIF DECISION (2188, 691), (322, 88) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION BeforeTrain = NULL; /* CIF ANSWER */ /* CIF Specific Geode Position (1981, 810), (150, 50) */ /* CIF Line (2349, 779), (2349, 794), (2056, 794), (2056, 810) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF TASK (1808, 890), (494, 70) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK DistTrains := distance - FDistance; /* CIF DECISION (1810, 990), (491, 96) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION DistTrains < DistStopPlusT; /* CIF ANSWER */ /* CIF Specific Geode Position (1785, 1116), (161, 50) */ /* CIF Line (2056, 1086), (2056, 1101), (1866, 1101), (1866, 1116) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF RETURN (1766, 1196), (200, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF ANSWER */ /* CIF Specific Geode Position (2076, 1116), (161, 50) */ /* CIF Line (2056, 1086), (2056, 1101), (2157, 1101), (2157, 1116) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF TASK (1986, 1196), (341, 84) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Speed := minimum (Speed + 1, MaxSpeed); /* CIF RETURN (2056, 1310), (200, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF End DECISION */ ENDDECISION; /* CIF ANSWER */ /* CIF Specific Geode Position (2440, 818), (150, 50) */ /* CIF Line (2349, 779), (2349, 794), (2515, 794), (2515, 818) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF TASK (2344, 905), (341, 84) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Speed := minimum (Speed + 1, MaxSpeed); /* CIF RETURN (2415, 1019), (200, 98) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF End DECISION */ ENDDECISION; /* CIF ANSWER */ /* CIF Specific Geode Position (2635, 1227), (161, 50) */ /* CIF Line (2715, 400), (2715, 415), (2716, 415), (2716, 1227) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF TASK (2395, 1307), (640, 109) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK DistanceStop := ( ( speed * (speed+1) ) / 2) +1, DistStopPlusT := (Speed + DistanceStop + DistSecurity); /* CIF DECISION (2557, 1446), (316, 119) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION BeforeTrain = NULL; /* CIF ANSWER */ /* CIF Specific Geode Position (2326, 1637), (150, 60) */ /* CIF Line (2715, 1565), (2715, 1580), (2401, 1580), (2401, 1637) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF DECISION (2153, 1727), (496, 125) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION distance - DistStopPlusT > 1; /* CIF ANSWER */ /* CIF Specific Geode Position (2114, 1882), (150, 50) */ /* CIF Line (2401, 1852), (2401, 1867), (2189, 1867), (2189, 1882) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF RETURN (2089, 1962), (200, 98) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF ANSWER */ /* CIF Specific Geode Position (2458, 1884), (161, 50) */ /* CIF Line (2401, 1852), (2401, 1867), (2539, 1867), (2539, 1884) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF TASK (2357, 1964), (364, 78) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Speed := Maximum (Speed - 1, 0); /* CIF RETURN (2439, 2073), (200, 98) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF End DECISION */ ENDDECISION; /* CIF ANSWER */ /* CIF Specific Geode Position (2958, 1595), (150, 60) */ /* CIF Line (2715, 1565), (2715, 1580), (3033, 1580), (3033, 1595) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF TASK (2775, 1685), (516, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK DistTrains := distance -FDistance; /* CIF DECISION (2798, 1801), (468, 96) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION DistStopPlusT < DistTrains; /* CIF ANSWER */ /* CIF Specific Geode Position (2808, 1941), (161, 50) */ /* CIF Line (3032, 1897), (3032, 1912), (2889, 1912), (2889, 1941) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF RETURN (2788, 2021), (200, 92) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF ANSWER */ /* CIF Specific Geode Position (3146, 1927), (150, 50) */ /* CIF Line (3032, 1897), (3032, 1912), (3221, 1912), (3221, 1927) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF TASK (3042, 2007), (358, 61) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Speed := Maximum (Speed - 1, 0); /* CIF RETURN (3121, 2098), (200, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF End DECISION */ ENDDECISION; /* CIF End DECISION */ ENDDECISION; /* CIF End DECISION */ ENDDECISION; /* CIF End STATE */ ENDSTATE; ENDPROCEDURE; /* CIF PROCEDURE (43, 2025), (335, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (20, 20), (1520, 1320) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ exported as RemoteTrainPosition PROCEDURE TrainPosition; returns Integer; /* CIF CurrentPage DefaultPartition */ /* CIF ProcedureStart (317, 233), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ START ; /* CIF RETURN (317, 383), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN distance + LongTrain; ENDPROCEDURE; /* CIF PROCEDURE (40, 1598), (468, 111) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (20, 20), (1520, 1320) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ exported as RemoteExitTrainBeforeYou PROCEDURE TrainBeforeYouExit; /* CIF CurrentPage DefaultPartition */ /* CIF ProcedureStart (475, 233), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ START ; /* CIF TASK (399, 383), (352, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK BeforeTrain:= NULL; /* CIF RETURN (475, 496), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; ENDPROCEDURE; /* CIF PROCEDURE (48, 1452), (426, 116) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (20, 20), (1520, 1320) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ exported as RemoteTrainAfterYou PROCEDURE TrainAfterYou; fpar RemotePID PID; /* CIF CurrentPage DefaultPartition */ /* CIF ProcedureStart (379, 218), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ START ; /* CIF TASK (292, 368), (375, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK AfterTrain:= RemotePID; /* CIF RETURN (379, 485), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; ENDPROCEDURE; /* CIF CurrentPage DefaultPartition */ /* CIF START (730, 141), (200, 95) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ START ; /* CIF TASK (654, 265), (352, 69) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK AfterTrain := NULL; /* CIF DECISION (646, 364), (367, 97) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION BeforeTrain = NULL; /* CIF ANSWER */ /* CIF Specific Geode Position (634, 490), (150, 60) */ /* CIF Line (830, 461), (830, 476), (709, 476), (709, 490) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF ANSWER */ /* CIF Specific Geode Position (875, 490), (150, 60) */ /* CIF Line (830, 461), (830, 476), (950, 476), (950, 490) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF ProcedureCall (729, 580), (443, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CALL RemoteTrainAfterYou(Self) To BeforeTrain; /* CIF End DECISION */ ENDDECISION; /* CIF DECISION (664, 708), (333, 97) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION TrainSpeed = slow; /* CIF ANSWER */ /* CIF Specific Geode Position (519, 835), (150, 60) */ /* CIF Line (831, 805), (831, 820), (594, 820), (594, 835) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF TASK (347, 925), (493, 151) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK distance := DistanceSlow, speed := SpeedSlow, MaxSpeed := SpeedSlow, SafeDistance := SafeSlowDistance; /* CIF OUTPUT (471, 1106), (245, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT InSensor (TrainSpeed); /* CIF SET (508, 1217), (172, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (0,t); /* CIF ANSWER */ /* CIF Specific Geode Position (1024, 835), (150, 60) */ /* CIF Line (831, 805), (831, 820), (1099, 820), (1099, 835) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF TASK (860, 925), (477, 148) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK distance := DistanceFast, speed :=SpeedFast, MaxSpeed := SpeedFast, SafeDistance := SafeFastDistance; /* CIF OUTPUT (980, 1103), (240, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT InSensor (TrainSpeed); /* CIF SET (1011, 1214), (177, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (0,t); /* CIF End DECISION */ ENDDECISION; /* CIF NEXTSTATE (749, 1343), (161, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Move; /* CIF CurrentPage DefaultPartition */ /* CIF STATE (2457, 120), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Move; /* CIF INPUT (2460, 279), (194, 92) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT t; /* CIF TASK (2320, 401), (477, 92) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK distance := distance - (speed*t1); /* CIF OUTPUT (2443, 523), (228, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT WhatColor; /* CIF NEXTSTATE (2457, 639), (200, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE WaitColor; /* CIF End STATE */ ENDSTATE; /* CIF STATE (3858, 129), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Stopped; /* CIF INPUT (3824, 279), (268, 98) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT t; /* CIF OUTPUT (3858, 407), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT WhatColor; /* CIF NEXTSTATE (3858, 557), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE WaitCol; /* CIF End STATE */ ENDSTATE; /* CIF STATE (4635, 112), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE OK; /* CIF INPUT (4635, 262), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT t; /* CIF TASK (4514, 412), (443, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK distance := distance - (speed*t1); /* CIF DECISION (4558, 562), (355, 119) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION distance <= ExitStop; /* CIF ANSWER */ /* CIF Specific Geode Position (4452, 711), (150, 60) */ /* CIF Line (4735, 681), (4735, 696), (4527, 696), (4527, 711) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF OUTPUT (4362, 801), (330, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT OutSensor(TrainSpeed); /* CIF OUTPUT (4393, 951), (268, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT ExitGate; /* CIF DECISION (4341, 1067), (372, 88) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION AfterTrain = NULL; /* CIF ANSWER */ /* CIF Specific Geode Position (4307, 1185), (150, 60) */ /* CIF Line (4527, 1155), (4527, 1170), (4382, 1170), (4382, 1185) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF ANSWER */ /* CIF Specific Geode Position (4602, 1185), (150, 60) */ /* CIF Line (4527, 1155), (4527, 1170), (4677, 1170), (4677, 1185) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF ProcedureCall (4482, 1275), (392, 78) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CALL RemoteExitTrainBeforeYou to AfterTrain; /* CIF End DECISION */ ENDDECISION; /* CIF SET (4424, 1398), (206, 92) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (1,t); /* CIF NEXTSTATE (4424, 1520), (206, 92) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE PostDead; /* CIF ANSWER */ /* CIF Specific Geode Position (4919, 714), (150, 60) */ /* CIF Line (4735, 681), (4735, 696), (4994, 696), (4994, 714) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF ProcedureCall (4846, 804), (296, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CALL ActualizeSpeed (accelerate); /* CIF SET (4874, 954), (239, 78) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (now+1,t); /* CIF NEXTSTATE (4894, 1076), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF End DECISION */ ENDDECISION; /* CIF End STATE */ ENDSTATE; /* CIF STATE (3838, 1720), (183, 98) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE PostDead; /* CIF INPUT (3830, 1848), (200, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT t; /* CIF STOP (3830, 1967), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STOP ; /* CIF End STATE */ ENDSTATE; /* CIF STATE (2457, 639), (200, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE WaitColor; /* CIF INPUT (2383, 758), (347, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT SColorStop(ColorS); /* CIF ProcedureCall (2429, 877), (256, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CALL EvaluateSpeed; /* CIF DECISION (2447, 990), (220, 111) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION ColorS; /* CIF ANSWER */ /* CIF Specific Geode Position (2141, 1131), (150, 60) */ /* CIF Line (2557, 1101), (2557, 1116), (2216, 1116), (2216, 1131) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( = Green ): /* CIF DECISION (2106, 1221), (220, 111) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION CanStop; /* CIF ANSWER */ /* CIF Specific Geode Position (1996, 1362), (150, 60) */ /* CIF Line (2216, 1332), (2216, 1347), (2071, 1347), (2071, 1362) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF ProcedureCall (1948, 1452), (245, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CALL ActualizeSpeed (accelerate); /* CIF SET (1974, 1568), (194, 78) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (now+1,t); /* CIF NEXTSTATE (1971, 1676), (200, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Move; /* CIF ANSWER */ /* CIF Specific Geode Position (2289, 1362), (150, 60) */ /* CIF Line (2216, 1332), (2216, 1347), (2364, 1347), (2364, 1362) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF ProcedureCall (2227, 1452), (273, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CALL ActualizeSpeed (accelerate); /* CIF SET (2244, 1568), (239, 78) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (now+1,t); /* CIF NEXTSTATE (2269, 1676), (189, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Ok; /* CIF End DECISION */ ENDDECISION; /* CIF ANSWER */ /* CIF Specific Geode Position (2763, 1131), (150, 60) */ /* CIF Line (2557, 1101), (2557, 1116), (2838, 1116), (2838, 1131) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( = Red ): /* CIF DECISION (2728, 1221), (220, 105) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION CanStop; /* CIF ANSWER */ /* CIF Specific Geode Position (2608, 1356), (150, 60) */ /* CIF Line (2838, 1326), (2838, 1341), (2683, 1341), (2683, 1356) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF ProcedureCall (2560, 1446), (246, 109) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CALL ActualizeSpeed (slowdown); /* CIF DECISION (2573, 1585), (220, 111) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION Speed = 0; /* CIF ANSWER */ /* CIF Specific Geode Position (2478, 1726), (150, 60) */ /* CIF Line (2683, 1696), (2683, 1711), (2553, 1711), (2553, 1726) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF SET (2433, 1816), (239, 78) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (now+1,t); /* CIF NEXTSTATE (2453, 1924), (200, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Stopped; /* CIF ANSWER */ /* CIF Specific Geode Position (2737, 1726), (150, 60) */ /* CIF Line (2683, 1696), (2683, 1711), (2812, 1711), (2812, 1726) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF SET (2693, 1816), (239, 78) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (now+1,t); /* CIF NEXTSTATE (2717, 1924), (189, 78) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Move; /* CIF End DECISION */ ENDDECISION; /* CIF ANSWER */ /* CIF Specific Geode Position (2952, 1356), (150, 60) */ /* CIF Line (2838, 1326), (2838, 1341), (3027, 1341), (3027, 1356) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF ProcedureCall (2905, 1446), (246, 109) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CALL ActualizeSpeed (accelerate); /* CIF SET (2907, 1585), (239, 78) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (now+1,t); /* CIF NEXTSTATE (2952, 1698), (150, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Ok; /* CIF End DECISION */ ENDDECISION; /* CIF End DECISION */ ENDDECISION; /* CIF End STATE */ ENDSTATE; /* CIF STATE (3858, 557), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE WaitCol; /* CIF INPUT (3776, 707), (364, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT SColorStop(ColorS); /* CIF DECISION (3848, 857), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION ColorS; /* CIF ANSWER */ /* CIF Specific Geode Position (3710, 1037), (150, 60) */ /* CIF Line (3958, 1007), (3958, 1022), (3785, 1022), (3785, 1037) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( = Green ): /* CIF ProcedureCall (3635, 1127), (302, 109) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CALL ActualizeSpeed (accelerate); /* CIF SET (3666, 1266), (239, 78) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (now+1,t); /* CIF NEXTSTATE (3685, 1374), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Move; /* CIF ANSWER */ /* CIF Specific Geode Position (4002, 1037), (150, 60) */ /* CIF Line (3958, 1007), (3958, 1022), (4077, 1022), (4077, 1037) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( = Red ): /* CIF SET (3957, 1127), (239, 78) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (now+1,t); /* CIF NEXTSTATE (3977, 1235), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Stopped; /* CIF End DECISION */ ENDDECISION; /* CIF End STATE */ ENDSTATE; ENDPROCESS TYPE; /* CIF CurrentPage DefaultPartition */ /* CIF PROCESS (118, 873), (200, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (20, 20), (1390, 1470) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ PROCESS StopTrain; /* CIF CurrentPage DefaultPartition */ /* CIF TEXT (40, 1260), (400, 200) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DCL Col ColorStop; /* CIF End Text */ /* CIF CurrentPage DefaultPartition */ /* CIF START (131, 137), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ START ; /* CIF TASK (131, 287), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Col := Red; /* CIF NEXTSTATE (131, 437), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Init; /* CIF CurrentPage DefaultPartition */ /* CIF STATE (799, 141), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Init; /* CIF INPUT (622, 291), (234, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT WhatColor; /* CIF OUTPUT (600, 441), (279, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT SColorStop(Col) to sender; /* CIF NEXTSTATE (639, 591), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Init; /* CIF INPUT (899, 297), (318, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT SColorStop(Col); /* CIF NEXTSTATE (958, 447), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Init; /* CIF End STATE */ ENDSTATE; ENDPROCESS; /* CIF PROCESS (1368, 1283), (251, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (20, 20), (1671, 2283) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ PROCESS SchedTrains; /* CIF CurrentPage DefaultPartition */ /* CIF TEXT (40, 1968), (775, 263) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DCL LongTrain, NTrainsLiving Integer; DCL PidLastTrain PID; DCL speed TSpeed; DCL NTrainsGenerated Integer; timer t_max; DCL TGeneration Integer; /* CIF End Text */ /* CIF CurrentPage DefaultPartition */ /* CIF START (125, 83), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ START ; /* CIF TASK (60, 233), (330, 131) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK NtrainsLiving := 0, NTrainsGenerated := 0; /* CIF NEXTSTATE (125, 394), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE WaitInitialize; /* CIF CurrentPage DefaultPartition */ /* CIF STATE (913, 60), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE WaitInitialize; /* CIF INPUT (901, 210), (223, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT Initialize2; /* CIF DECISION (903, 326), (220, 97) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION any; /* CIF ANSWER */ /* CIF Specific Geode Position (435, 453), (150, 50) */ /* CIF Line (1013, 423), (1013, 438), (510, 438), (510, 453) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( ): /* CIF TASK (359, 533), (302, 156) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK speed := fast, TGeneration:= 4, LongTrain := short, PidLastTrain := NULL; /* CIF ANSWER */ /* CIF Specific Geode Position (771, 453), (150, 50) */ /* CIF Line (1013, 423), (1013, 438), (846, 438), (846, 453) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( ): /* CIF TASK (690, 533), (313, 159) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK speed := fast, TGeneration := 4, LongTrain := large, PidLastTrain :=NULL; /* CIF ANSWER */ /* CIF Specific Geode Position (1104, 453), (150, 50) */ /* CIF Line (1013, 423), (1013, 438), (1179, 438), (1179, 453) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( ): /* CIF TASK (1023, 533), (313, 159) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK speed := slow, TGeneration := 2, LongTrain := short, PidLastTrain :=NULL; /* CIF ANSWER */ /* CIF Specific Geode Position (1439, 453), (150, 50) */ /* CIF Line (1013, 423), (1013, 438), (1514, 438), (1514, 453) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( ): /* CIF TASK (1358, 533), (313, 159) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK speed := slow, TGeneration := 2, LongTrain := large, PidLastTrain :=NULL; /* CIF End DECISION */ ENDDECISION; /* CIF SET (893, 737), (239, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (0, t_max); /* CIF NEXTSTATE (910, 853), (206, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Init; /* CIF End STATE */ ENDSTATE; /* CIF STATE (49, 761), (234, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE EndGeneration; /* CIF INPUT (65, 875), (200, 61) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT ExitGate; /* CIF NEXTSTATE (40, 966), (251, 78) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE EndGeneration; /* CIF End STATE */ ENDSTATE; /* CIF STATE (910, 853), (206, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Init; /* CIF INPUT (685, 969), (200, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT t_max; /* CIF DECISION (506, 1088), (558, 102) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION NtrainsGenerated < MaxTrains; /* CIF ANSWER */ /* CIF Specific Geode Position (498, 1240), (150, 50) */ /* CIF Line (785, 1190), (785, 1205), (573, 1205), (573, 1240) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF CREATE (287, 1320), (572, 92) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CREATE Train (speed, PidLastTrain, LongTrain); /* CIF TASK (275, 1442), (595, 109) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK PidLastTrain := Offspring, NTrainsLiving := NTrainsLiving +1, NTrainsGenerated := NTrainsGenerated + 1; /* CIF SET (386, 1581), (375, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (now+TGeneration, t_max); /* CIF NEXTSTATE (470, 1694), (206, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Init; /* CIF ANSWER */ /* CIF Specific Geode Position (862, 1639), (150, 50) */ /* CIF Line (785, 1190), (785, 1205), (937, 1205), (937, 1639) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF SET (808, 1719), (257, 69) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (now+1, t_max); /* CIF NEXTSTATE (837, 1818), (200, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Init; /* CIF End DECISION */ ENDDECISION; /* CIF INPUT (1273, 970), (200, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT ExitGate; /* CIF TASK (1137, 1086), (471, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK NtrainsLiving := NtrainsLiving -1; /* CIF DECISION (1215, 1197), (316, 125) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION NTrainsLiving = 0; /* CIF ANSWER */ /* CIF Specific Geode Position (1172, 1352), (150, 50) */ /* CIF Line (1373, 1322), (1373, 1337), (1247, 1337), (1247, 1352) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF TASK (1096, 1432), (302, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK PidLastTrain :=NULL; /* CIF ANSWER */ /* CIF Specific Geode Position (1435, 1352), (150, 50) */ /* CIF Line (1373, 1322), (1373, 1337), (1510, 1337), (1510, 1352) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF End DECISION */ ENDDECISION; /* CIF DECISION (1085, 1560), (576, 147) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION NtrainsGenerated = MaxTrains and NtrainsLiving = 0; /* CIF ANSWER */ /* CIF Specific Geode Position (1151, 1737), (150, 60) */ /* CIF Line (1373, 1707), (1373, 1722), (1226, 1722), (1226, 1737) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( = true ): /* CIF RESET (1100, 1827), (251, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RESET (t_max); /* CIF NEXTSTATE (1090, 1946), (273, 92) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE EndGeneration; /* CIF ANSWER */ /* CIF Specific Geode Position (1433, 1737), (150, 60) */ /* CIF Line (1373, 1707), (1373, 1722), (1508, 1722), (1508, 1737) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( = false ): /* CIF NEXTSTATE (1428, 1827), (161, 73) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Init; /* CIF End DECISION */ ENDDECISION; /* CIF End STATE */ ENDSTATE; ENDPROCESS; /* CIF PROCESS (418, 1286), (742, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF GateReference (1015, 1266) */ /* CIF TextPosition (0, 0) */ /* CIF Specific Geode TextName Tr_Sen */ /* CIF GateReference (468, 1266) */ /* CIF TextPosition (0, 0) */ /* CIF Specific Geode TextName Stop_to_Train */ /* CIF GateReference (1140, 1383) */ /* CIF TextPosition (0, 0) */ /* CIF Specific Geode TextName T_Sched */ PROCESS Train(0) : TypeTrains; /* CIF PROCESS (1165, 889), (200, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (20, 20), (1520, 1320) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ PROCESS Sensor; /* CIF CurrentPage DefaultPartition */ /* CIF TEXT (45, 1019), (1303, 217) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DCL speed TSpeed; /* CIF End Text */ /* CIF CurrentPage DefaultPartition */ /* CIF START (405, 187), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ START ; /* CIF NEXTSTATE (405, 337), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Init; /* CIF STATE (405, 337), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Init; /* CIF INPUT (146, 490), (313, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT OutSensor(speed); /* CIF OUTPUT (143, 640), (318, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT OutSensor(speed); /* CIF NEXTSTATE (202, 790), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF INPUT (551, 487), (290, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT InSensor(speed); /* CIF OUTPUT (548, 637), (296, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT InSensor(speed); /* CIF NEXTSTATE (596, 787), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF End STATE */ ENDSTATE; ENDPROCESS; /* CIF PROCESS (642, 465), (245, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (20, 20), (1596, 1990) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ PROCESS MessagesHandler; /* CIF CurrentPage DefaultPartition */ /* CIF TEXT (431, 134), (1150, 310) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DCL Col ColorStop; DCL speed TSpeed; /* CIF End Text */ /* CIF CurrentPage DefaultPartition */ /* CIF START (97, 151), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ START ; /* CIF OUTPUT (97, 301), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT Initialize; /* CIF NEXTSTATE (97, 451), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE WaitSignalInit; /* CIF STATE (97, 451), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE WaitSignalInit; /* CIF INPUT (41, 601), (313, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT SColorStop(Col); /* CIF OUTPUT (41, 751), (313, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT SColorStop(Col); /* CIF OUTPUT (97, 901), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT Initialize2; /* CIF NEXTSTATE (98, 1051), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE WaitSignal; /* CIF End STATE */ ENDSTATE; /* CIF CurrentPage DefaultPartition */ /* CIF STATE (468, 1278), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE WaitSignal; /* CIF INPUT (63, 1428), (313, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT SColorStop(Col); /* CIF OUTPUT (63, 1578), (313, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT SColorStop(Col); /* CIF NEXTSTATE (120, 1728), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE WaitSignal; /* CIF INPUT (396, 1428), (330, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT InSensor(speed); /* CIF OUTPUT (402, 1578), (318, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT InSensor(speed); /* CIF NEXTSTATE (461, 1728), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE WaitSignal; /* CIF INPUT (746, 1428), (341, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT OutSensor(speed); /* CIF OUTPUT (746, 1578), (341, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT OutSensor(speed); /* CIF NEXTSTATE (816, 1728), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE WaitSignal; /* CIF End STATE */ ENDSTATE; ENDPROCESS; ENDBLOCK TYPE; /* CIF CurrentPage DefaultPartition */ /* CIF BLOCK (1002, 1112), (551, 240) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (280, 43), (1139, 1290) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ BLOCK GateCars; /* CIF CurrentPage DefaultPartition */ /* CIF SIGNALROUTE (280, 315) , (747, 315) */ /* CIF TextPosition (386, 272) */ /* CIF TextPosition (554, 356) SignalList1 */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode TextMode 2 Siglist1 */ /* CIF Keep Specific Geode TextMode 2 Siglist2 */ /* CIF Keep Specific Geode Modified */ SIGNALROUTE Cars_Cont FROM ENV TO CarGate WITH CmdGate; /* CIF SIGNALROUTE (849, 391) , (849, 693) */ /* CIF TextPosition (689, 542) */ /* CIF TextPosition (884, 600) SignalList1 */ /* CIF TextPosition (879, 423) SignalList2 */ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode TextMode 6 Siglist1 */ /* CIF Keep Specific Geode TextMode 6 Siglist2 */ /* CIF Keep Specific Geode Modified */ SIGNALROUTE G_to_Sen FROM CarGate TO CarsSensor WITH CmdGate; FROM CarsSensor TO CarGate WITH GateStatus; /* CIF SIGNALROUTE (752, 770) , (280, 315) */ /* CIF TextPosition (404, 583) */ /* CIF TextPosition (235, 438) SignalList1 */ /* CIF TextPosition (549, 760) SignalList2 */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode TextMode 2 Siglist1 */ /* CIF Keep Specific Geode TextMode 2 Siglist2 */ /* CIF Keep Specific Geode Modified */ SIGNALROUTE C_to_C FROM CarsSensor TO ENV WITH NCars; FROM ENV TO CarsSensor WITH QNCars; /* CIF CurrentPage DefaultPartition */ /* CIF CONNECT */ /* CIF Keep Specific Geode Position (260, 295) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CONNECT Ctr_to_Cars AND Cars_Cont, C_to_C; /* CIF CurrentPage DefaultPartition */ /* CIF PROCESS (747, 241), (200, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (20, 20), (3466, 2288) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ PROCESS CarGate; /* CIF CurrentPage DefaultPartition */ /* CIF TEXT (65, 1805), (738, 369) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DCL CmdG, NewCmdG, StateGate CGate; Timer t; /* CIF End Text */ /* CIF CurrentPage DefaultPartition */ /* CIF START (111, 157), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ START ; /* CIF NEXTSTATE (125, 307), (172, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE WaitInit; /* CIF STATE (125, 307), (172, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE WaitInit; /* CIF INPUT (51, 420), (318, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT CmdGate(CmdG); /* CIF TASK (40, 540), (341, 92) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK StateGate := CmdG; /* CIF NEXTSTATE (119, 661), (183, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Init; /* CIF End STATE */ ENDSTATE; /* CIF CurrentPage DefaultPartition */ /* CIF STATE (494, 829), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Init; /* CIF INPUT (181, 979), (330, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT CmdGate(CmdG); /* CIF DECISION (157, 1093), (378, 111) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION CmdG = StateGate; /* CIF ANSWER */ /* CIF Specific Geode Position (131, 1233), (150, 60) */ /* CIF Line (346, 1204), (346, 1219), (206, 1219), (206, 1233) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF NEXTSTATE (125, 1323), (161, 92) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Init; /* CIF ANSWER */ /* CIF Specific Geode Position (412, 1234), (150, 60) */ /* CIF Line (346, 1204), (346, 1219), (487, 1219), (487, 1234) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF DECISION (315, 1324), (344, 99) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION CmdG = OpenGate; /* CIF ANSWER */ /* CIF Specific Geode Position (286, 1453), (150, 60) */ /* CIF Line (487, 1423), (487, 1438), (361, 1438), (361, 1453) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF SET (245, 1543), (233, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (now+1,t); /* CIF NEXTSTATE (266, 1654), (189, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE StepTwo; /* CIF ANSWER */ /* CIF Specific Geode Position (539, 1453), (150, 60) */ /* CIF Line (487, 1423), (487, 1438), (614, 1438), (614, 1453) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF SET (498, 1543), (233, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (now+1,t); /* CIF NEXTSTATE (522, 1654), (183, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE StepOne; /* CIF End DECISION */ ENDDECISION; /* CIF End DECISION */ ENDDECISION; /* CIF INPUT (658, 979), (239, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT GateStatus; /* CIF OUTPUT (618, 1095), (319, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT CmdGate(StateGate); /* CIF NEXTSTATE (683, 1209), (189, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Init; /* CIF End STATE */ ENDSTATE; /* CIF STATE (2616, 86), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE StepOne; /* CIF INPUT (1843, 236), (386, 66) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT CmdGate(NewCmdG); /* CIF DECISION (1847, 332), (378, 74) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION CmdG = NewCmdG; /* CIF ANSWER */ /* CIF Specific Geode Position (1800, 437), (150, 50) */ /* CIF Line (2036, 406), (2036, 421), (1875, 421), (1875, 437) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF NEXTSTATE (1792, 517), (166, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF ANSWER */ /* CIF Specific Geode Position (2109, 437), (150, 60) */ /* CIF Line (2036, 406), (2036, 421), (2184, 421), (2184, 437) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF TASK (2039, 527), (290, 67) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK CmdG := NewCmdG; /* CIF DECISION (1984, 624), (401, 75) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION CmdG = OpenGate; /* CIF ANSWER */ /* CIF Specific Geode Position (1971, 729), (150, 60) */ /* CIF Line (2185, 699), (2185, 714), (2046, 714), (2046, 729) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF TASK (1898, 819), (296, 67) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK StateGate := CmdG; /* CIF RESET (1940, 916), (211, 69) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RESET (t); /* CIF NEXTSTATE (1951, 1015), (189, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Init; /* CIF ANSWER */ /* CIF Specific Geode Position (2255, 729), (150, 60) */ /* CIF Line (2185, 699), (2185, 714), (2330, 714), (2330, 729) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF SET (2214, 819), (233, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (now+1,t); /* CIF NEXTSTATE (2236, 930), (189, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE StepTwo; /* CIF End DECISION */ ENDDECISION; /* CIF End DECISION */ ENDDECISION; /* CIF INPUT (2606, 236), (200, 66) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT t; /* CIF DECISION (2517, 332), (378, 97) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION CmdG = OpenGate; /* CIF ANSWER */ /* CIF Specific Geode Position (2487, 459), (150, 60) */ /* CIF Line (2706, 429), (2706, 444), (2562, 444), (2562, 459) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF TASK (2414, 549), (296, 72) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK StateGate := CmdG; /* CIF RESET (2456, 652), (211, 69) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RESET (t); /* CIF NEXTSTATE (2467, 763), (189, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Init; /* CIF ANSWER */ /* CIF Specific Geode Position (2771, 459), (150, 60) */ /* CIF Line (2706, 429), (2706, 444), (2846, 444), (2846, 459) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF SET (2730, 549), (233, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (now+1,t); /* CIF NEXTSTATE (2752, 660), (189, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE StepTwo; /* CIF End DECISION */ ENDDECISION; /* CIF INPUT (2938, 239), (240, 66) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT GateStatus; /* CIF OUTPUT (2946, 335), (223, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT CmdGate (CloseGate); /* CIF NEXTSTATE (2983, 448), (150, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF End STATE */ ENDSTATE; /* CIF STATE (2667, 1183), (200, 109) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE StepTwo; /* CIF INPUT (1843, 1322), (397, 69) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT CmdGate(NewCmdG); /* CIF DECISION (1853, 1421), (378, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION CmdG = NewCmdG; /* CIF ANSWER */ /* CIF Specific Geode Position (1803, 1537), (150, 60) */ /* CIF Line (2042, 1507), (2042, 1522), (1878, 1522), (1878, 1537) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF NEXTSTATE (1795, 1627), (166, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF ANSWER */ /* CIF Specific Geode Position (2127, 1537), (150, 60) */ /* CIF Line (2042, 1507), (2042, 1522), (2202, 1522), (2202, 1537) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF TASK (2056, 1627), (290, 75) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK CmdG := NewCmdG; /* CIF DECISION (2013, 1732), (378, 88) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION CmdG = OpenGate; /* CIF ANSWER */ /* CIF Specific Geode Position (1983, 1850), (150, 60) */ /* CIF Line (2202, 1820), (2202, 1835), (2058, 1835), (2058, 1850) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF SET (1941, 1940), (233, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (now+1,t); /* CIF NEXTSTATE (1963, 2051), (189, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE StepOne; /* CIF ANSWER */ /* CIF Specific Geode Position (2267, 1850), (150, 60) */ /* CIF Line (2202, 1820), (2202, 1835), (2342, 1835), (2342, 1850) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF TASK (2194, 1940), (296, 78) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK StateGate := CmdG; /* CIF RESET (2237, 2048), (211, 69) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RESET (t); /* CIF NEXTSTATE (2256, 2147), (172, 66) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Init; /* CIF End DECISION */ ENDDECISION; /* CIF End DECISION */ ENDDECISION; /* CIF INPUT (2643, 1322), (189, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT t; /* CIF DECISION (2549, 1438), (378, 119) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION CmdG = OpenGate; /* CIF ANSWER */ /* CIF Specific Geode Position (2520, 1587), (150, 60) */ /* CIF Line (2738, 1557), (2738, 1572), (2595, 1572), (2595, 1587) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF SET (2479, 1677), (233, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (now+1,t); /* CIF NEXTSTATE (2500, 1788), (189, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE StepOne; /* CIF ANSWER */ /* CIF Specific Geode Position (2805, 1587), (150, 60) */ /* CIF Line (2738, 1557), (2738, 1572), (2880, 1572), (2880, 1587) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF TASK (2732, 1677), (296, 78) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK StateGate := CmdG; /* CIF RESET (2774, 1785), (211, 69) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RESET (t); /* CIF NEXTSTATE (2786, 1884), (189, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Init; /* CIF End DECISION */ ENDDECISION; /* CIF INPUT (2950, 1322), (239, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT GateStatus; /* CIF OUTPUT (2969, 1438), (201, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT CmdGate (CloseGate); /* CIF NEXTSTATE (2975, 1551), (189, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF End STATE */ ENDSTATE; ENDPROCESS; /* CIF PROCESS (752, 693), (200, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (20, 20), (1653, 2180) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ PROCESS CarsSensor; /* CIF CurrentPage DefaultPartition */ /* CIF TEXT (65, 1750), (755, 251) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DCL NumCars Integer; DCL cmd CGate; TIMER Time_out; synonym increase = 1; synonym decrease = -1; /* CIF End Text */ /* CIF CurrentPage DefaultPartition */ /* CIF PROCEDURE (65, 1497), (293, 125) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (20, 20), (1668, 1891) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ PROCEDURE ActualizeNCars; FPAR inc Integer; /* CIF CurrentPage DefaultPartition */ /* CIF ProcedureStart (752, 280), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ START ; /* CIF DECISION (742, 430), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION inc = increase; /* CIF ANSWER */ /* CIF Specific Geode Position (398, 610), (150, 60) */ /* CIF Line (852, 580), (852, 595), (473, 595), (473, 610) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF DECISION (120, 700), (706, 125) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION NumCars + CarsArrival > CarsBorneSup; /* CIF ANSWER */ /* CIF Specific Geode Position (155, 855), (150, 60) */ /* CIF Line (473, 825), (473, 840), (230, 840), (230, 855) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF TASK (40, 945), (380, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK NumCars := CarsBorneSup; /* CIF ANSWER */ /* CIF Specific Geode Position (598, 855), (150, 60) */ /* CIF Line (473, 825), (473, 840), (673, 840), (673, 855) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF TASK (440, 945), (465, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK NumCars := NumCars + CarsArrival; /* CIF End DECISION */ ENDDECISION; /* CIF RETURN (373, 1073), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF ANSWER */ /* CIF Specific Geode Position (1274, 610), (150, 60) */ /* CIF Line (852, 580), (852, 595), (1349, 595), (1349, 610) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF DECISION (1089, 700), (519, 122) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION NumCars -CarsDepart > 0; /* CIF ANSWER */ /* CIF Specific Geode Position (1092, 851), (150, 60) */ /* CIF Line (1349, 822), (1349, 837), (1167, 837), (1167, 851) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF TASK (925, 941), (483, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK NumCars := NumCars - CarsDepart; /* CIF ANSWER */ /* CIF Specific Geode Position (1473, 851), (150, 60) */ /* CIF Line (1349, 822), (1349, 837), (1548, 837), (1548, 851) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF TASK (1428, 941), (240, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK NumCars := 0; /* CIF End DECISION */ ENDDECISION; /* CIF RETURN (1249, 1067), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF End DECISION */ ENDDECISION; ENDPROCEDURE; /* CIF CurrentPage DefaultPartition */ /* CIF START (111, 89), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ START ; /* CIF NEXTSTATE (91, 239), (239, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE WaitInitialization; /* CIF STATE (91, 239), (239, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE WaitInitialization; /* CIF INPUT (71, 358), (279, 92) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT QNCars; /* CIF TASK (111, 480), (200, 95) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK NumCars :=0; /* CIF SET (71, 605), (279, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (0,Time_out); /* CIF NEXTSTATE (114, 724), (194, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Init; /* CIF End STATE */ ENDSTATE; /* CIF CurrentPage DefaultPartition */ /* CIF STATE (790, 60), (200, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Init; /* CIF INPUT (598, 188), (228, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT Time_out; /* CIF OUTPUT (584, 307), (256, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT GateStatus; /* CIF NEXTSTATE (615, 521), (194, 78) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE WaitAnswer; /* CIF INPUT (891, 191), (279, 92) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT QNCars; /* CIF OUTPUT (860, 312), (341, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT NCars(NumCars); /* CIF NEXTSTATE (934, 429), (194, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Init; /* CIF End STATE */ ENDSTATE; /* CIF STATE (615, 521), (194, 78) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE WaitAnswer; /* CIF INPUT (561, 629), (301, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT CmdGate(cmd); /* CIF DECISION (534, 748), (355, 85) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION cmd = OpenGate; /* CIF ANSWER */ /* CIF Specific Geode Position (434, 864), (150, 60) */ /* CIF Line (712, 833), (712, 848), (509, 848), (509, 864) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF ProcedureCall (355, 954), (307, 69) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CALL ActualizeNCars (decrease); /* CIF SET (378, 1053), (262, 72) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (now+1,Time_out); /* CIF NEXTSTATE (417, 1155), (183, 67) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Init; /* CIF ANSWER */ /* CIF Specific Geode Position (838, 864), (150, 60) */ /* CIF Line (712, 833), (712, 848), (913, 848), (913, 864) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF ProcedureCall (785, 954), (256, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CALL ActualizeNCars (increase); /* CIF DECISION (719, 1073), (389, 99) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION NumCars > CarsBorneSup; /* CIF ANSWER */ /* CIF Specific Geode Position (713, 1202), (150, 60) */ /* CIF Line (914, 1172), (914, 1187), (788, 1187), (788, 1202) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF OUTPUT (620, 1292), (335, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT NCars(NumCars); /* CIF ANSWER */ /* CIF Specific Geode Position (1009, 1202), (150, 60) */ /* CIF Line (914, 1172), (914, 1187), (1084, 1187), (1084, 1202) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF End DECISION */ ENDDECISION; /* CIF SET (782, 1423), (262, 72) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (now+1,Time_out); /* CIF NEXTSTATE (816, 1525), (194, 78) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Init; /* CIF End DECISION */ ENDDECISION; /* CIF INPUT (1039, 629), (279, 92) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT QNCars; /* CIF OUTPUT (1008, 750), (341, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT NCars(NumCars); /* CIF NEXTSTATE (1082, 867), (194, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Init; /* CIF End STATE */ ENDSTATE; ENDPROCESS; ENDBLOCK; /* CIF BLOCK (1002, 687), (544, 268) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF GateReference (982, 895) */ /* CIF TextPosition (0, 0) */ /* CIF Specific Geode TextName C_to_Track */ BLOCK Track (MaxTracks) : Tracks; /* CIF BLOCK (116, 538), (250, 940) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (262, 54), (1179, 1443) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ BLOCK Controller; /* CIF CurrentPage DefaultPartition */ /* CIF SIGNALROUTE (262, 439) , (735, 439) */ /* CIF TextPosition (340, 449) */ /* CIF TextPosition (608, 449) SignalList1 */ /* CIF TextPosition (298, 309) SignalList2 */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode TextMode 2 Siglist1 */ /* CIF Keep Specific Geode TextMode 2 Siglist2 */ /* CIF Keep Specific Geode Modified */ SIGNALROUTE C_to_Cars FROM ENV TO Controller WITH NCars; FROM Controller TO ENV WITH CmdGate, QNCars; /* CIF SIGNALROUTE (262, 804) , (735, 804) */ /* CIF TextPosition (320, 814) */ /* CIF TextPosition (547, 837) SignalList1 */ /* CIF TextPosition (295, 722) SignalList2 */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode TextMode 2 Siglist1 */ /* CIF Keep Specific Geode TextMode 2 Siglist2 */ /* CIF Keep Specific Geode Modified */ SIGNALROUTE C_to_Track FROM ENV TO Controller WITH InSensor, OutSensor, Initialize; FROM Controller TO ENV WITH SColorStop; /* CIF CurrentPage DefaultPartition */ /* CIF CONNECT */ /* CIF Keep Specific Geode Position (242, 419) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CONNECT Ctr_to_Cars AND C_to_Cars; /* CIF CONNECT */ /* CIF Keep Specific Geode Position (242, 784) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CONNECT C_to_Track AND C_to_Track; /* CIF CurrentPage DefaultPartition */ /* CIF PROCESS (735, 336), (200, 659) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page 1 (2100, 2970) */ /* CIF Frame (20, 20), (1520, 1851) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (20, 20), (1698, 2332) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ PROCESS Controller; /* CIF CurrentPage 1 */ /* CIF TEXT (40, 60), (1457, 1742) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEWTYPE PidTable ARRAY (TypeTrackNumber, PID) OPERATORS TrackNumber : PID, PidTable -> TypeTrackNumber; FindTrackNum : TypeTrackNumber, PID, PidTable -> TypeTrackNumber; AXIOMS FOR ALL p in PID ( FOR ALL PTable in PidTable ( FOR ALL i in TypeTrackNumber ( TrackNumber(p, PTable) == FindTrackNum(MaxTracks, p, PTable); FindTrackNum(i, p, PTable) == if i = 0 then 0 else ( IF PTable(i) = p THEN i ELSE FindTrackNum(i-1, p, PTable) FI) FI ))); ENDNEWTYPE PidTable; NEWTYPE t_element_track STRUCT NumTrack TypeTrackNumber; NumTrains Integer; PidStop PID; PidProcess1 PID; PidProcess2 PID; ENDNEWTYPE t_element_track; NEWTYPE TypeTrackList Array (TypeTrackNumber, t_element_track) ENDNEWTYPE; DCL NumTrains Integer; DCL TypeTrain TSpeed; DCL NumCars Integer; DCL NumTrack, NDeadTracks TypeTrackNumber; DCL TrackList TypeTrackList; DCL NumTGV, t_trains Integer; DCL StateGate CGate; DCL Situation TypeSituation; DCL PidsTable PidTable; DCL TPriority Boolean; Timer remember; /* CIF End Text */ /* CIF CurrentPage DefaultPartition */ /* CIF PROCEDURE (1019, 112), (304, 100) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (20, 20), (1646, 2151) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ PROCEDURE InitializeTracks; /* CIF CurrentPage DefaultPartition */ /* CIF TEXT (68, 118), (727, 509) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DCL i TypeTrackNumber; /* CIF End Text */ /* CIF CurrentPage DefaultPartition */ /* CIF ProcedureStart (1073, 63), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ START ; /* CIF TASK (1081, 213), (183, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK i:=0; /* CIF LABEL (1045, 332), (256, 114) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ cycle: /* CIF NEXTSTATE (1059, 476), (228, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE WaitIdentTrack; /* CIF STATE (1059, 476), (228, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE WaitIdentTrack; /* CIF INPUT (1059, 626), (228, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT Initialize; /* CIF TASK (949, 745), (448, 188) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK TrackList(i)!NumTrack := i, TrackList(i)!NumTrains := 0, TrackList(i)!PidStop := sender, PidsTable(i) := sender, i:=i+1; /* CIF DECISION (1018, 963), (310, 116) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION i = MaxTracks; /* CIF ANSWER */ /* CIF Specific Geode Position (981, 1110), (150, 50) */ /* CIF Line (1173, 1079), (1173, 1094), (1056, 1094), (1056, 1110) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF TASK (967, 1190), (177, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK i:=0; /* CIF LABEL (933, 1300), (245, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ cycle2: /* CIF OUTPUT (888, 1450), (336, 89) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT SColorStop(Red) to TrackList(i)!PidStop; /* CIF TASK (962, 1569), (189, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK i := i+1; /* CIF DECISION (946, 1680), (220, 125) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION i = MaxTracks; /* CIF ANSWER */ /* CIF Specific Geode Position (868, 1835), (150, 50) */ /* CIF Line (1056, 1805), (1056, 1820), (943, 1820), (943, 1835) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF RETURN (843, 1915), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF ANSWER */ /* CIF Specific Geode Position (1099, 1835), (150, 50) */ /* CIF Line (1056, 1805), (1056, 1820), (1174, 1820), (1174, 1835) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF JOIN (1074, 1915), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ JOIN cycle2; /* CIF End DECISION */ ENDDECISION; /* CIF ANSWER */ /* CIF Specific Geode Position (1224, 1110), (150, 60) */ /* CIF Line (1173, 1079), (1173, 1094), (1299, 1094), (1299, 1110) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ELSE: /* CIF JOIN (1199, 1200), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ JOIN cycle; /* CIF End DECISION */ ENDDECISION; /* CIF End STATE */ ENDSTATE; ENDPROCEDURE; /* CIF PROCEDURE (642, 113), (304, 94) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2970, 2100) */ /* CIF Frame (20, 20), (2446, 1466) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ PROCEDURE EvaluateSituation; /* CIF CurrentPage DefaultPartition */ /* CIF PROCEDURE (1599, 67), (338, 97) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (20, 20), (1520, 1378) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ PROCEDURE EvaluatePriority; /* CIF CurrentPage DefaultPartition */ /* CIF ProcedureStart (505, 148), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ START ; /* CIF DECISION (456, 298), (299, 119) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION NumTrains; /* CIF ANSWER */ /* CIF Specific Geode Position (93, 447), (150, 60) */ /* CIF Line (606, 417), (606, 432), (168, 432), (168, 447) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( >1 ): /* CIF TASK (60, 537), (217, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Tpriority := true; /* CIF TASK (40, 651), (256, 72) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK t_trains := 0; /* CIF RETURN (68, 753), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF ANSWER */ /* CIF Specific Geode Position (511, 447), (150, 60) */ /* CIF Line (606, 417), (606, 432), (586, 432), (586, 447) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( =1 ): /* CIF DECISION (476, 537), (220, 111) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION NumTGV > 0; /* CIF ANSWER */ /* CIF Specific Geode Position (341, 678), (150, 60) */ /* CIF Line (586, 648), (586, 663), (416, 663), (416, 678) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF TASK (308, 768), (217, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Tpriority := true; /* CIF TASK (288, 881), (256, 72) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK t_trains := 0; /* CIF RETURN (316, 983), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF ANSWER */ /* CIF Specific Geode Position (684, 683), (150, 60) */ /* CIF Line (586, 648), (586, 663), (759, 663), (759, 683) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF TASK (597, 773), (324, 72) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK t_trains := t_trains +1; /* CIF DECISION (576, 876), (367, 94) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION t_trains >= t_limite; /* CIF ANSWER */ /* CIF Specific Geode Position (570, 999), (150, 60) */ /* CIF Line (760, 970), (760, 985), (645, 985), (645, 999) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF TASK (536, 1089), (217, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Tpriority := true; /* CIF RETURN (545, 1203), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF ANSWER */ /* CIF Specific Geode Position (798, 999), (150, 60) */ /* CIF Line (760, 970), (760, 985), (873, 985), (873, 999) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF RETURN (773, 1089), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF End DECISION */ ENDDECISION; /* CIF End DECISION */ ENDDECISION; /* CIF ANSWER */ /* CIF Specific Geode Position (987, 447), (150, 60) */ /* CIF Line (606, 417), (606, 432), (1062, 432), (1062, 447) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( = 0 ): /* CIF TASK (954, 537), (217, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Tpriority := false; /* CIF TASK (934, 651), (256, 72) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK t_trains := 0; /* CIF RETURN (962, 753), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF End DECISION */ ENDDECISION; ENDPROCEDURE; /* CIF CurrentPage DefaultPartition */ /* CIF ProcedureStart (876, 91), (200, 72) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ START ; /* CIF ProcedureCall (831, 193), (290, 92) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CALL EvaluatePriority; /* CIF DECISION (830, 315), (293, 85) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION TPriority; /* CIF ANSWER */ /* CIF Specific Geode Position (257, 430), (144, 50) */ /* CIF Line (977, 400), (977, 415), (329, 415), (329, 430) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF DECISION (171, 510), (316, 91) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION NumTrains > 0; /* CIF ANSWER */ /* CIF Specific Geode Position (111, 631), (150, 60) */ /* CIF Line (329, 601), (329, 616), (186, 616), (186, 631) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF TASK (41, 721), (290, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Situation := ExitTrainsPriority; /* CIF ANSWER */ /* CIF Specific Geode Position (379, 631), (150, 60) */ /* CIF Line (329, 601), (329, 616), (454, 616), (454, 631) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF TASK (351, 721), (206, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Situation := TrainsPriority; /* CIF End DECISION */ ENDDECISION; /* CIF RETURN (229, 852), (200, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF ANSWER */ /* CIF Specific Geode Position (1453, 430), (144, 50) */ /* CIF Line (977, 400), (977, 415), (1525, 415), (1525, 430) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF DECISION (1336, 510), (378, 53) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION NumTrains; /* CIF ANSWER */ /* CIF Specific Geode Position (960, 593), (218, 50) */ /* CIF Line (1525, 563), (1525, 578), (1069, 578), (1069, 593) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( = 1 ): /* CIF DECISION (911, 673), (316, 63) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION StateGate; /* CIF ANSWER */ /* CIF Specific Geode Position (623, 769), (167, 50) */ /* CIF Line (1069, 736), (1069, 751), (707, 751), (707, 769) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( = OpenGate ): /* CIF DECISION (597, 849), (220, 74) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION NumCars; /* CIF ANSWER */ /* CIF Specific Geode Position (503, 953), (190, 53) */ /* CIF Line (707, 923), (707, 938), (598, 938), (598, 953) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( >= CarsBorneSup ): /* CIF TASK (402, 1036), (392, 70) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Situation := OneTrainManyCarsGOpen; /* CIF RETURN (498, 1135), (200, 86) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF ANSWER */ /* CIF Specific Geode Position (873, 953), (240, 50) */ /* CIF Line (707, 923), (707, 938), (993, 938), (993, 953) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( < CarsBorneSup ): /* CIF TASK (814, 1033), (358, 75) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Situation := OneTrainFewCarsGOpen; /* CIF RETURN (893, 1137), (200, 72) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF End DECISION */ ENDDECISION; /* CIF ANSWER */ /* CIF Specific Geode Position (1444, 766), (179, 50) */ /* CIF Line (1069, 736), (1069, 751), (1534, 751), (1534, 766) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( =CloseGate ): /* CIF DECISION (1423, 846), (220, 71) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION NumCars; /* CIF ANSWER */ /* CIF Specific Geode Position (1226, 947), (274, 50) */ /* CIF Line (1533, 917), (1533, 932), (1363, 932), (1363, 947) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( >= CarsBorneSup ): /* CIF TASK (1192, 1027), (341, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Situation := OneTrainManyCarsGClose; /* CIF RETURN (1263, 1141), (200, 75) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF ANSWER */ /* CIF Specific Geode Position (1611, 947), (229, 50) */ /* CIF Line (1533, 917), (1533, 932), (1726, 932), (1726, 947) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( < CarsBorneSup ): /* CIF TASK (1553, 1027), (346, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Situation := OneTrainFewCarsGClose; /* CIF RETURN (1626, 1140), (200, 75) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF End DECISION */ ENDDECISION; /* CIF End DECISION */ ENDDECISION; /* CIF ANSWER */ /* CIF Specific Geode Position (2131, 593), (150, 64) */ /* CIF Line (1525, 563), (1525, 578), (2206, 578), (2206, 593) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( = 0 ): /* CIF DECISION (2096, 687), (220, 80) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION StateGate; /* CIF ANSWER */ /* CIF Specific Geode Position (1930, 799), (178, 50) */ /* CIF Line (2206, 767), (2206, 782), (2019, 782), (2019, 799) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( = CloseGate ): /* CIF TASK (1874, 879), (290, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Situation := NoTrainsGClose; /* CIF RETURN (1919, 990), (200, 81) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF ANSWER */ /* CIF Specific Geode Position (2229, 797), (173, 50) */ /* CIF Line (2206, 767), (2206, 782), (2316, 782), (2316, 797) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( =OpenGate ): /* CIF TASK (2184, 877), (262, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Situation := NoTrainsGOpen; /* CIF RETURN (2216, 990), (200, 83) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF End DECISION */ ENDDECISION;