/* CIF SYSTEMDiagram */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Specific Geode Version @(V) tool=geodedit V4.1.2 format=SDL96 nested=yes cif=yes */ /* CIF Keep Specific Geode LastModified Sun May 12 10:04:09 2002 */ /* CIF Page General information (2970, 2100) */ /* CIF Frame (40, 40), (1500, 1290) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ /* CIF Page Types (2970, 2100) */ /* CIF Frame (40, 40), (1500, 1060) */ /* 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), (1629, 1284) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ SYSTEM Railroad; /* CIF CurrentPage General information */ /* CIF TEXT (97, 122), (1359, 1129) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* Railway crossing controller specification * * Authors : * Eric Conquet - Maxime Perrotin * May 2002 * * Designed for the SDL Contest of the 3rd SAM Workshop * */ /* CIF End Text */ /* CIF CurrentPage Types */ /* CIF TEXT (60, 94), (974, 777) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ movement_ty ::= ENUMERATED { waiting, moving }; /* Type "movement_ty" defines if the train that approaches is moving or is stopped */ Priority_ty ::= ENUMERATED { all_trains, fast_trains, cars, automatic_priority }; /* Defines all the possible priority strategies */ Priority_time duration ::=10; /* In automatic priority mode, the priority level will decrease every "priority_time" ticks. */ High_priority natural ::= 3; /* Defines the highest priority level for the automatic priority mode */ CLOSING_TIME DURATION ::= 5; /* Closing_Time : constant time needed for the gates to be closed. */ PASSING_TIME DURATION ::= 10; /* Time after which it is considered that the entire train has passed over the sensors */ /* CIF End Text */ /* CIF CurrentPage DefaultPartition */ /* CIF TEXT (96, 118), (400, 391) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ signal car_sensor; signal train, Leaving; signal open, close; signal Manual_open, Manual_close, Manual_wait, Manual_go, Set_Priority (Priority_ty); /* CIF End Text */ /* CIF CurrentPage DefaultPartition */ /* CIF CHANNEL (40, 656) , (614, 656) */ /* CIF TextPosition (302, 666) */ /* CIF TextPosition (418, 693) SignalList1 */ /* 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 Cars FROM ENV TO Railroad_Control WITH car_sensor; ENDCHANNEL; /* CIF CHANNEL (1669, 590) , (864, 590) */ /* CIF TextPosition (1027, 598) */ /* CIF TextPosition (889, 606) SignalList1 */ /* 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 Normal_Trains FROM ENV TO Railroad_Control WITH Train, Leaving; ENDCHANNEL; /* CIF CHANNEL (732, 547) , (732, 40) */ /* CIF TextPosition (651, 279) */ /* CIF TextPosition (761, 215) SignalList1 */ /* 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 */ CHANNEL Gates FROM Railroad_Control TO ENV WITH open, close; ENDCHANNEL; /* CIF CHANNEL (1669, 755) , (864, 755) */ /* CIF TextPosition (1277, 755) */ /* CIF TextPosition (913, 769) SignalList1 */ /* 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 */ CHANNEL Fast_Trains FROM ENV TO Railroad_Control WITH Train, Leaving; ENDCHANNEL; /* CIF CHANNEL (730, 1324) , (730, 805) */ /* CIF TextPosition (740, 1065) */ /* CIF TextPosition (762, 881) SignalList1 */ /* 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 */ CHANNEL Manual_Control FROM ENV TO Railroad_Control WITH Manual_open, Manual_close, Manual_wait, Manual_go, Set_Priority; ENDCHANNEL; /* CIF CurrentPage DefaultPartition */ /* CIF BLOCK (614, 547), (250, 258) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2100, 2970) */ /* CIF Frame (275, 40), (1225, 1222) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Preview 0 0 0 */ BLOCK Railroad_Control /* CIF COMMENT (99, 831), (435, 266) */ /* CIF Keep Specific Geode Font '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-bold-r-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*'*/ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode Modified */ COMMENT 'The Railroad_Control block contains the description of the system controller and the tracks which include the stopping signal for the trains. The system is generic in the number of tracks.'; /* CIF CurrentPage DefaultPartition */ /* CIF TEXT (934, 788), (493, 200) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ signal wait, go, approaching_normal(movement_ty), approaching_fast(movement_ty); /* CIF End Text */ /* CIF CurrentPage DefaultPartition */ /* CIF SIGNALROUTE (797, 656) , (1500, 656) */ /* CIF TextPosition (1134, 617) */ /* CIF TextPosition (1261, 666) 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 Gates FROM Controller TO ENV WITH open, close; /* CIF SIGNALROUTE (704, 1262) , (704, 847) */ /* CIF TextPosition (714, 1054) */ /* CIF TextPosition (715, 903) 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 Cars FROM ENV TO Controller WITH car_sensor; /* CIF SIGNALROUTE (527, 261) , (527, 444) , (646, 444) , (646, 567) */ /* CIF TextPosition (556, 401) */ /* CIF TextPosition (381, 473) SignalList1 */ /* CIF TextPosition (444, 305) SignalList2 */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode TextMode 6 Siglist1 */ /* CIF Keep Specific Geode TextMode 6 Siglist2 */ /* CIF Keep Specific Geode Modified */ SIGNALROUTE Ctrl_Normal FROM Normal VIA CTRL TO Controller WITH approaching_normal, leaving; FROM Controller TO Normal VIA CTRL WITH wait, go; /* CIF SIGNALROUTE (854, 266) , (854, 451) , (747, 451) , (747, 567) */ /* CIF TextPosition (738, 410) */ /* CIF TextPosition (777, 472) SignalList1 */ /* CIF TextPosition (876, 319) SignalList2 */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode TextMode 6 Siglist1 */ /* CIF Keep Specific Geode TextMode 6 Siglist2 */ /* CIF Keep Specific Geode Modified */ SIGNALROUTE Ctrl_Fast FROM Fast VIA CTRL TO Controller WITH approaching_fast, leaving; FROM Controller TO Fast VIA CTRL WITH wait, go; /* CIF SIGNALROUTE (510, 40) , (510, 111) */ /* CIF TextPosition (518, 34) */ /* CIF TextPosition (522, 67) 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 Normal_trains FROM ENV TO Normal VIA TRAIN WITH Train, Leaving; /* CIF SIGNALROUTE (846, 40) , (846, 116) */ /* CIF TextPosition (862, 36) */ /* CIF TextPosition (880, 74) 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 Fast_trains FROM ENV TO Fast VIA TRAIN WITH Train, Leaving; /* CIF SIGNALROUTE (275, 656) , (597, 656) */ /* CIF TextPosition (342, 616) */ /* CIF TextPosition (381, 677) 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 manual_control FROM ENV TO Controller WITH Manual_open, Manual_close, Manual_wait, Manual_go, Set_Priority; /* CIF CurrentPage DefaultPartition */ /* CIF CONNECT */ /* CIF Keep Specific Geode Position (1480, 636) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CONNECT Gates AND Gates; /* CIF CONNECT */ /* CIF Keep Specific Geode Position (684, 1242) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CONNECT Cars AND Cars; /* CIF CONNECT */ /* CIF Keep Specific Geode Position (490, 20) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CONNECT Normal_trains AND Normal_trains; /* CIF CONNECT */ /* CIF Keep Specific Geode Position (826, 20) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CONNECT Fast_Trains AND Fast_trains; /* CIF CONNECT */ /* CIF Keep Specific Geode Position (255, 636) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CONNECT Manual_Control AND manual_control; /* CIF CurrentPage DefaultPartition */ /* CIF ProcessType (1166, 60), (200, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page Declarations (2970, 2100) */ /* 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 */ /* CIF Page Behaviour (2970, 2100) */ /* CIF Frame (20, 20), (4280, 1756) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ PROCESS TYPE Track ; /* CIF CurrentPage Behaviour */ /* CIF GATE (4300, 307), (4400, 307) */ /* 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 */ /* CIF TextPosition (4318, 272) */ /* CIF TextPosition (4219, 295) SignalList1 */ GATE TRAIN IN WITH train, leaving; /* CIF GATE (4300, 680), (4400, 680) */ /* 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 */ /* CIF TextPosition (4323, 644) */ /* CIF TextPosition (4204, 695) SignalList1 */ /* CIF TextPosition (4321, 704) SignalList2 */ GATE CTRL IN WITH go, wait; OUT WITH approaching, leaving; /* CIF CurrentPage Declarations */ /* CIF TEXT (821, 60), (670, 523) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ dcl train_passing natural := 0; dcl wait boolean := false; /* variable "wait" to prevent setting the wait signal while there are still some trains between the two sensors */ dcl new_train boolean := true; /* variable "new_train" is used to distinguish an approaching signal from a new train than from the wheels of a train currently on the sensor (change C3 in the specificqtion) */ timer leaving_timer,approaching_timer; /* Time after which it is considered that the entire train has passed over the sensors */ /* CIF End Text */ /* CIF TEXT (40, 84), (760, 489) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* This process manages the traffic * light (the stopping signal) associated to * each track (Fast or normal). * * * "Track" is a process type with context parameter * for the signal "approaching". It can be used for fast and * normal speed tracks by using a different name for * this signal. * * */ /* CIF End Text */ /* CIF CurrentPage Behaviour */ /* CIF START (390, 93), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ START ; /* CIF NEXTSTATE (390, 243), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE red; /* CIF STATE (390, 243), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE red; /* CIF INPUT (175, 395), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT wait /* CIF COMMENT (395, 395), (139, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'From Controller'; /* CIF NEXTSTATE (175, 545), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE - /* CIF COMMENT (40, 545), (115, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Discard signal'; /* CIF INPUT (604, 393), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT train /* CIF COMMENT (824, 393), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Sensor indicates that a train is approachnig'; /* CIF EnablingCondition (554, 543), (301, 149) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ PROVIDED (train_passing= 0) or (train_passing=1 and new_train=false) /* CIF COMMENT (930, 535), (245, 157) */ /* CIF Keep Specific Geode Font '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-bold-r-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*'*/ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Prevents simulator for sending several trains when the light is red'; /* CIF DECISION (594, 722), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION new_train; /* CIF ANSWER */ /* CIF Specific Geode Position (479, 902), (150, 60) */ /* CIF Line (704, 872), (704, 887), (554, 887), (554, 902) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF TASK (454, 992), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK new_train := false; /* CIF TASK (422, 1142), (264, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK train_passing := train_passing + 1; /* CIF OUTPUT (454, 1292), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT approaching (WAITING) /* CIF COMMENT (674, 1292), (160, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'To Controller'; /* CIF ANSWER */ /* CIF Specific Geode Position (779, 902), (150, 60) */ /* CIF Line (704, 872), (704, 887), (854, 887), (854, 902) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF End DECISION */ ENDDECISION; /* CIF SET (570, 1457), (269, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET(now+ PASSING_TIME, approaching_timer); /* CIF NEXTSTATE (604, 1607), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF End STATE */ ENDSTATE; /* CIF CurrentPage Behaviour */ /* CIF STATE (1407, 738), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE red, green; /* CIF INPUT (1190, 888), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT go /* CIF COMMENT (1410, 888), (139, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'From Controller'; /* CIF TASK (1190, 1038), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK wait := false; /* CIF NEXTSTATE (1190, 1188), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE green; /* CIF INPUT (1569, 888), (311, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT approaching_timer /* CIF COMMENT (1900, 888), (303, 173) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Sequence of approaching signals is finished. Wait for a new train on the track.'; /* CIF TASK (1624, 1038), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK new_train := true; /* CIF NEXTSTATE (1624, 1188), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF End STATE */ ENDSTATE; /* CIF STATE (3152, 99), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE green; /* CIF INPUT (1959, 249), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT leaving /* CIF COMMENT (2179, 249), (282, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Sensor indicates that the train is leaving the crossing station'; /* CIF EnablingCondition (1908, 399), (300, 149) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ PROVIDED (train_passing>10) or (train_passing=1 and new_train=true) /* CIF COMMENT (2229, 399), (306, 136) */ /* CIF Keep Specific Geode Font '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-bold-r-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*'*/ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Prevents simulator from sending Leaving signal when no train is on the track'; /* CIF SET (1938, 578), (242, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET(now+ PASSING_TIME, leaving_timer); /* CIF NEXTSTATE (1959, 728), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF INPUT (2705, 249), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT train /* CIF COMMENT (2925, 249), (224, 123) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Sensor indicates that a train is approachnig'; /* CIF DECISION (2695, 399), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION new_train; /* CIF ANSWER */ /* CIF Specific Geode Position (2480, 579), (150, 60) */ /* CIF Line (2805, 549), (2805, 564), (2555, 564), (2555, 579) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF TASK (2455, 669), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK new_train := false; /* CIF TASK (2426, 819), (258, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK train_passing := train_passing + 1; /* CIF OUTPUT (2455, 969), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT approaching (MOVING) /* CIF COMMENT (2675, 969), (160, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'To Controller'; /* CIF ANSWER */ /* CIF Specific Geode Position (2980, 579), (150, 60) */ /* CIF Line (2805, 549), (2805, 564), (3055, 564), (3055, 579) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF End DECISION */ ENDDECISION; /* CIF SET (2673, 1134), (264, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET(now+ PASSING_TIME, approaching_timer); /* CIF NEXTSTATE (2705, 1284), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF INPUT (3235, 249), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT wait /* CIF COMMENT (3455, 249), (139, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'From Controller'; /* CIF DECISION (3225, 399), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION train_passing = 0 /* CIF COMMENT (3465, 414), (162, 120) */ /* CIF Keep Specific Geode Font '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-bold-r-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*'*/ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Change C1 in spec'; /* CIF ANSWER */ /* CIF Specific Geode Position (3150, 579), (150, 60) */ /* CIF Line (3335, 549), (3335, 564), (3225, 564), (3225, 579) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF NEXTSTATE (3125, 669), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE red; /* CIF ANSWER */ /* CIF Specific Geode Position (3370, 579), (150, 60) */ /* CIF Line (3335, 549), (3335, 564), (3445, 564), (3445, 579) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF TASK (3345, 669), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK wait := true; /* CIF NEXTSTATE (3345, 819), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF End DECISION */ ENDDECISION; /* CIF INPUT (3795, 249), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT leaving_timer; /* CIF OUTPUT (3795, 399), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT leaving /* CIF COMMENT (4015, 399), (160, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'To Controller'; /* CIF TASK (3782, 549), (226, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK train_passing := train_passing - 1; /* CIF DECISION (3785, 699), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION wait and train_passing=0 /* CIF COMMENT (3565, 714), (200, 120) */ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Has the "wait" signal been received ?'; /* CIF ANSWER */ /* CIF Specific Geode Position (3710, 879), (150, 60) */ /* CIF Line (3895, 849), (3895, 864), (3785, 864), (3785, 879) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF TASK (3685, 969), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK wait := false; /* CIF NEXTSTATE (3685, 1119), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE red; /* CIF ANSWER */ /* CIF Specific Geode Position (3930, 879), (150, 60) */ /* CIF Line (3895, 849), (3895, 864), (4005, 864), (4005, 879) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF NEXTSTATE (3905, 969), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF End DECISION */ ENDDECISION; /* CIF End STATE */ ENDSTATE; ENDPROCESS TYPE; /* CIF ProcessType (1162, 227), (200, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2970, 2100) */ /* 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 TYPE Fast_Track inherits Track ; ENDPROCESS TYPE; /* CIF ProcessType (1158, 401), (200, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2970, 2100) */ /* 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 TYPE Normal_Track inherits Track ; ENDPROCESS TYPE; /* CIF CurrentPage DefaultPartition */ /* CIF PROCESS (597, 567), (200, 280) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page Declarations (2970, 2100) */ /* CIF Frame (20, 20), (1131, 1401) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ /* CIF Page Startup (2970, 2100) */ /* CIF Frame (20, 20), (2594, 1301) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ /* CIF Page Wait_Train (2970, 2100) */ /* CIF Frame (20, 20), (1343, 1228) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ /* CIF Page Wait_Cars (2970, 2100) */ /* CIF Frame (20, 20), (1588, 1342) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ /* CIF Page Train_Pass (2100, 2970) */ /* CIF Frame (20, 20), (2937, 1649) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ /* CIF Page Car_Pass (2100, 2970) */ /* CIF Frame (20, 20), (1692, 1779) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ /* CIF Page Manual_control (2970, 2100) */ /* CIF Frame (20, 20), (2191, 1174) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ /* CIF Page Manually_stopped (2100, 2970) */ /* CIF Frame (20, 20), (2347, 1510) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ /* CIF Page Manually_opened (2100, 2970) */ /* CIF Frame (20, 20), (2229, 1523) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ /* CIF Page Manually_allowed (2100, 2970) */ /* CIF Frame (20, 20), (1506, 1812) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ /* CIF Page Manually_closed (2970, 2100) */ /* CIF Frame (20, 20), (2332, 1384) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ PROCESS Controller (1,1); /* CIF CurrentPage Declarations */ /* CIF TEXT (43, 76), (1072, 1135) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ dcl passing natural := 0; /* "passing" counts the number of trains currently passing on one track. */ dcl stopped natural :=0; /* "stopped" counts the number of trains waiting for authorization to pass. */ dcl more_than_one boolean := false; /* "more_than_one" is set to true if too many cars are waiting ar the gate. */ Timer closed_timer; /* "closed_timer" is the timer needed for closing the gates */ dcl Priority_train_id pid := null; /* "Priority_train_id stores the PID of a train with priority over cars. It is used for sending the "go" signal to this train after closing the gates (the "Close_Gates" procedure uses a timer which change the "sender" value). */ dcl movement movement_ty; /* "movement" is used to determine if the train which approaches is stopped or * not, in the particular case when the controller expects the lights to be all red : it can * actually be passing if it follows another train which has not left, as the track is not * allowed to set the stopping signal when there is a train between the two sensors. * Possible values are "WAITING" and "MOVING". */ dcl Passing_priority Priority_ty := fast_trains; /* "Passing_priority" is used to set the priority strategy */ dcl Priority_level natural := 0; /* "priority_level" is used in automatic priority mode to know when to change the * priority strategy. It start with a high value and starts decreasing as time goes on. */ timer Priority_timer; /* "priority_timer" is used in automatic priority mode to decrease the priority level */ /* CIF End Text */ /* CIF CurrentPage Manual_control */ /* CIF TEXT (59, 964), (400, 200) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* Control of the passage to manual mode, avoiding unsafe actions for each nominal state of the system. */ /* CIF End Text */ /* CIF CurrentPage Declarations */ /* CIF PROCEDURE (40, 1241), (219, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF Page DefaultPartition (2970, 2100) */ /* CIF Frame (20, 20), (1584, 1681) */ /* CIF Keep Specific Geode TextMode 0 */ /* CIF Keep Specific Geode Modified */ /* CIF Keep Specific Geode Preview 0 0 0 */ PROCEDURE Close_Gates /* CIF COMMENT (279, 1256), (325, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'This procedure closes the gates and wait a contant delay to be sure that the operation is finished.'; /* CIF CurrentPage DefaultPartition */ /* CIF TEXT (1037, 116), (547, 232) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* Procedure Close_Gate -- Send the "Close" signal to the gates for the cars and wait a certain (constant) tme until they are actually closed. */ /* CIF End Text */ /* CIF CurrentPage DefaultPartition */ /* CIF ProcedureStart (500, 60), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ START ; /* CIF OUTPUT (500, 210), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT close via Gates; /* CIF SET (500, 360), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (now+ CLOSING_TIME, closed_timer); /* CIF NEXTSTATE (500, 510), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE wait_gates; /* CIF STATE (500, 510), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE wait_gates; /* CIF INPUT (69, 660), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT closed_timer; /* CIF RETURN (69, 810), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RETURN ; /* CIF SAVE (289, 660), (327, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SAVE approaching_fast, approaching_normal, set_priority, car_sensor /* CIF COMMENT (636, 660), (242, 120) */ /* CIF Keep Specific Geode Font '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-bold-r-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*'*/ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Save other important signals'; /* CIF INPUT (898, 660), (264, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT Priority_timer /* CIF COMMENT (1182, 639), (279, 162) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'In "automatic priority" mode, decrease the priority level each time the timer expires.'; /* CIF SET (887, 810), (285, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (NOW+Priority_time, Priority_timer); /* CIF DECISION (920, 960), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION Priority_level; /* CIF ANSWER */ /* CIF Specific Geode Position (814, 1140), (150, 60) */ /* CIF Line (1030, 1110), (1030, 1125), (889, 1125), (889, 1140) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( 0 ): /* CIF TASK (729, 1230), (322, 136) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing_priority:= if passing_priority=cars then all_trains else cars fi /* CIF COMMENT (490, 1230), (219, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Change the priority strategy automatically'; /* CIF TASK (789, 1396), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Priority_level := High_priority; /* CIF ANSWER */ /* CIF Specific Geode Position (1095, 1140), (150, 60) */ /* CIF Line (1030, 1110), (1030, 1125), (1170, 1125), (1170, 1140) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ELSE: /* CIF TASK (1070, 1230), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Priority_level := Priority_level-1; /* CIF End DECISION */ ENDDECISION; /* CIF NEXTSTATE (930, 1561), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF End STATE */ ENDSTATE; ENDPROCEDURE; /* CIF CurrentPage Startup */ /* CIF START (80, 131), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ START /* CIF COMMENT (305, 112), (370, 152) */ /* CIF Keep Specific Geode Font '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-bold-r-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*'*/ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Start-up : no trains waiting, the gate is closed and the stopping signal is set (red light)'; /* CIF NEXTSTATE (46, 368), (269, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Manually_stopped /* CIF COMMENT (345, 358), (277, 139) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'The operator will manually start the system by choosing a priority setting'; /* CIF CurrentPage Startup */ /* CIF STATE (760, 117), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE * /* CIF COMMENT (980, 117), (200, 120) */ /* CIF Keep Specific Geode Font '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-bold-r-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*'*/ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Common behaviour for all states'; /* CIF INPUT (741, 267), (237, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT car_sensor /* CIF COMMENT (999, 272), (214, 115) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Car sensor can change state at any time'; /* CIF TASK (700, 417), (320, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK more_than_one:= not(more_than_one); /* CIF NEXTSTATE (760, 567), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF End STATE */ ENDSTATE; /* CIF STATE (1667, 77), (205, 131) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Wait_Train, Wait_Cars, Train_Pass, Car_Pass; /* CIF INPUT (1233, 238), (279, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT set_priority (passing_priority) /* CIF COMMENT (1537, 237), (237, 123) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Change the priority mode'; /* CIF DECISION (1263, 388), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION passing_priority /* CIF COMMENT (1516, 390), (295, 146) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'In "automatic priority" mode, activate a timer to start decreasing the priority level.'; /* CIF ANSWER */ /* CIF Specific Geode Position (1113, 568), (256, 60) */ /* CIF Line (1373, 538), (1373, 553), (1241, 553), (1241, 568) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( automatic_priority ): /* CIF SET (1099, 658), (285, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (NOW+Priority_time, Priority_timer); /* CIF TASK (1127, 808), (226, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Priority_level := High_Priority; /* CIF TASK (1125, 958), (232, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing_priority := cars; /* CIF ANSWER */ /* CIF Specific Geode Position (1429, 568), (150, 60) */ /* CIF Line (1373, 538), (1373, 553), (1504, 553), (1504, 568) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ELSE: /* CIF RESET (1404, 658), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RESET (priority_timer); /* CIF End DECISION */ ENDDECISION; /* CIF NEXTSTATE (1272, 1123), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF INPUT (2032, 238), (264, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT Priority_timer /* CIF COMMENT (2315, 217), (279, 162) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'In "automatic priority" mode, decrease the priority level each time the timer expires.'; /* CIF SET (2021, 388), (285, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (NOW+Priority_time, Priority_timer); /* CIF DECISION (2053, 538), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION Priority_level; /* CIF ANSWER */ /* CIF Specific Geode Position (1948, 718), (150, 60) */ /* CIF Line (2163, 688), (2163, 703), (2023, 703), (2023, 718) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( 0 ): /* CIF TASK (1862, 808), (322, 136) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing_priority:= if passing_priority=cars then all_trains else cars fi /* CIF COMMENT (1624, 808), (219, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Change the priority strategy automatically'; /* CIF TASK (1923, 974), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Priority_level := High_priority; /* CIF ANSWER */ /* CIF Specific Geode Position (2229, 718), (150, 60) */ /* CIF Line (2163, 688), (2163, 703), (2304, 703), (2304, 718) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ELSE: /* CIF TASK (2204, 808), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Priority_level := Priority_level-1; /* CIF End DECISION */ ENDDECISION; /* CIF NEXTSTATE (2063, 1139), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF End STATE */ ENDSTATE; /* CIF CurrentPage Wait_Train */ /* CIF STATE (150, 197), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Wait_Train /* CIF COMMENT (370, 197), (264, 120) */ /* CIF Keep Specific Geode Font '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-bold-r-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*'*/ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Gates opened. Waiting for a train.'; /* CIF INPUT (96, 349), (305, 120) */ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode Modified */ INPUT approaching_fast, approaching_normal /* CIF COMMENT (422, 349), (240, 144) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'A train arrives on a track (normal or fast)'; /* CIF TASK (148, 499), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing := 1; /* CIF ProcedureCall (149, 649), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CALL Close_Gates /* CIF COMMENT (369, 649), (226, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'The gates are closed to let the train pass'; /* CIF OUTPUT (148, 799), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT go to * /* CIF COMMENT (368, 799), (287, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'All future trains are allowed to pass'; /* CIF NEXTSTATE (148, 949), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Wait_Cars; /* CIF ContinuousSignal (682, 347), (327, 223) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ PROVIDED more_than_one and (passing_priority=cars or passing_priority =fast_trains) /* CIF COMMENT (1037, 365), (287, 184) */ /* CIF Keep Specific Geode Font '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-bold-r-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*'*/ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Exceptional behaviour : the car sensor is activated whereas the gate is opened'; /* CIF NEXTSTATE (746, 600), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Car_Pass /* CIF COMMENT (966, 600), (279, 144) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'In "priority to cars" mode, wait for the sensor to switch off'; /* CIF End STATE */ ENDSTATE; /* CIF CurrentPage Wait_Cars */ /* CIF STATE (655, 173), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Wait_Cars /* CIF COMMENT (875, 173), (293, 120) */ /* CIF Keep Specific Geode Font '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-bold-r-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*'*/ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'One or more trains are passing.'; /* CIF INPUT (117, 325), (303, 120) */ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode Modified */ INPUT approaching_fast, approaching_normal /* CIF COMMENT (440, 325), (183, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'More trains are approaching.'; /* CIF TASK (168, 475), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing := passing +1; /* CIF NEXTSTATE (168, 625), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Wait_Cars; /* CIF INPUT (643, 327), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT Leaving /* CIF COMMENT (863, 327), (134, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'One train is leaving'; /* CIF TASK (643, 477), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing := passing -1; /* CIF DECISION (633, 627), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION passing /* CIF COMMENT (873, 642), (149, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Is it the last train ?'; /* CIF ANSWER */ /* CIF Specific Geode Position (558, 807), (150, 60) */ /* CIF Line (743, 777), (743, 792), (633, 792), (633, 807) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( >0 ): /* CIF NEXTSTATE (533, 897), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Wait_Cars; /* CIF ANSWER */ /* CIF Specific Geode Position (778, 807), (150, 60) */ /* CIF Line (743, 777), (743, 792), (853, 792), (853, 807) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( 0 ): /* CIF OUTPUT (753, 897), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT wait to * /* CIF COMMENT (973, 897), (134, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'To all tracks'; /* CIF OUTPUT (753, 1047), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT open via Gates; /* CIF NEXTSTATE (753, 1197), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Wait_Train; /* CIF End DECISION */ ENDDECISION; /* CIF ContinuousSignal (1023, 323), (327, 189) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ PROVIDED more_than_one and (passing_priority=cars or passing_priority =fast_trains) /* CIF COMMENT (1369, 323), (219, 133) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Too many cars are waiting (car sensor activated)'; /* CIF OUTPUT (1086, 542), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT wait to * /* CIF COMMENT (1306, 542), (187, 136) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Stop future trains when all the tracks are free'; /* CIF NEXTSTATE (1086, 708), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Train_Pass; /* CIF End STATE */ ENDSTATE; /* CIF CurrentPage Train_Pass */ /* CIF STATE (1558, 177), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Train_Pass /* CIF COMMENT (1778, 60), (357, 236) */ /* CIF Keep Specific Geode Font '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-bold-r-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*'*/ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Gates closed but too many cars waiting. Future trains are stopped (except fast trains); waiting for current trains to leave before we can open the gates again.'; /* CIF INPUT (467, 327), (255, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT approaching_fast (movement); /* CIF DECISION (484, 477), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION passing_priority /* CIF COMMENT (724, 492), (189, 120) */ /* CIF Keep Specific Geode Font '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-bold-r-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*'*/ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Priority to fast trains ?'; /* CIF ANSWER */ /* CIF Specific Geode Position (239, 657), (150, 60) */ /* CIF Line (594, 627), (594, 642), (314, 642), (314, 657) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( fast_trains ): /* CIF TASK (214, 747), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing := passing+1; /* CIF DECISION (204, 897), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION movement /* CIF COMMENT (444, 912), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'How many trains already on this track ?'; /* CIF ANSWER */ /* CIF Specific Geode Position (65, 1077), (150, 60) */ /* CIF Line (314, 1047), (314, 1062), (140, 1062), (140, 1077) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( WAITING ): /* CIF OUTPUT (40, 1167), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT go to sender /* CIF COMMENT (260, 1167), (160, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Authorize this train to pass'; /* CIF OUTPUT (40, 1317), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT wait to sender /* CIF COMMENT (260, 1317), (206, 152) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Then stop the forthcoming ones when the track is free again'; /* CIF ANSWER */ /* CIF Specific Geode Position (412, 1077), (150, 60) */ /* CIF Line (314, 1047), (314, 1062), (487, 1062), (487, 1077) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( MOVING ): /* CIF End DECISION */ ENDDECISION; /* CIF ANSWER */ /* CIF Specific Geode Position (799, 657), (150, 60) */ /* CIF Line (594, 627), (594, 642), (874, 642), (874, 657) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ELSE: /* CIF DECISION (764, 747), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION movement /* CIF COMMENT (1004, 762), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'How many trains already on this track ?'; /* CIF ANSWER */ /* CIF Specific Geode Position (689, 927), (150, 60) */ /* CIF Line (874, 897), (874, 912), (764, 912), (764, 927) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( WAITING ): /* CIF TASK (664, 1017), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK stopped := stopped + 1; /* CIF ANSWER */ /* CIF Specific Geode Position (909, 927), (150, 60) */ /* CIF Line (874, 897), (874, 912), (984, 912), (984, 927) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( MOVING ): /* CIF TASK (884, 1017), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing:= passing+1; /* CIF End DECISION */ ENDDECISION; /* CIF End DECISION */ ENDDECISION; /* CIF NEXTSTATE (494, 1529), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Train_Pass; /* CIF INPUT (1339, 329), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT Leaving /* CIF COMMENT (1559, 329), (134, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'One train is leaving'; /* CIF TASK (1339, 479), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing:= passing-1; /* CIF DECISION (1329, 629), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION passing /* CIF COMMENT (1569, 644), (149, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Is it the last train ?'; /* CIF ANSWER */ /* CIF Specific Geode Position (1249, 809), (150, 60) */ /* CIF Line (1439, 779), (1439, 794), (1324, 794), (1324, 809) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( >0 ): /* CIF NEXTSTATE (1224, 899), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Train_Pass; /* CIF ANSWER */ /* CIF Specific Geode Position (1479, 809), (150, 62) */ /* CIF Line (1439, 779), (1439, 794), (1554, 794), (1554, 809) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( 0 ): /* CIF OUTPUT (1454, 901), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT open via Gates /* CIF COMMENT (1674, 901), (148, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Let the cars pass'; /* CIF NEXTSTATE (1454, 1051), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Car_Pass; /* CIF End DECISION */ ENDDECISION; /* CIF INPUT (1805, 327), (285, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT approaching_normal (movement); /* CIF DECISION (1838, 477), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION movement /* CIF COMMENT (2078, 492), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'How many trains already on this track ?'; /* CIF ANSWER */ /* CIF Specific Geode Position (1763, 657), (150, 60) */ /* CIF Line (1948, 627), (1948, 642), (1838, 642), (1838, 657) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( WAITING ): /* CIF TASK (1738, 747), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK stopped := stopped + 1; /* CIF ANSWER */ /* CIF Specific Geode Position (1983, 657), (150, 60) */ /* CIF Line (1948, 627), (1948, 642), (2058, 642), (2058, 657) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( MOVING ): /* CIF TASK (1958, 747), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing:= passing+1; /* CIF End DECISION */ ENDDECISION; /* CIF NEXTSTATE (1848, 912), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Train_Pass; /* CIF ContinuousSignal (2298, 327), (311, 186) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ PROVIDED not (more_than_one) or passing_priority =all_trains /* CIF COMMENT (2642, 311), (295, 219) */ /* CIF Keep Specific Geode Font '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-bold-r-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*'*/ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Exceptional behaviour : the car sensor is deactivated whereas the gate is closed, or priority mode has changed'; /* CIF OUTPUT (2353, 543), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT go to * /* CIF COMMENT (2581, 548), (187, 109) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'All trains can pass therefore'; /* CIF TASK (2327, 693), (253, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing := passing+stopped, stopped:=0; /* CIF NEXTSTATE (2353, 843), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Wait_Cars; /* CIF End STATE */ ENDSTATE; /* CIF CurrentPage Car_Pass */ /* CIF STATE (608, 101), (200, 118) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Car_Pass /* CIF COMMENT (828, 68), (327, 147) */ /* CIF Keep Specific Geode Font '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-bold-r-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*'*/ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Gates opened Car sensor active (priority to cars or to fast trains)'; /* CIF INPUT (40, 254), (325, 120) */ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode Modified */ INPUT approaching_normal; /* CIF TASK (102, 404), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK stopped := stopped +1 /* CIF COMMENT (322, 404), (181, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Normal speed trains are stopped'; /* CIF NEXTSTATE (102, 554), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Car_Pass; /* CIF INPUT (576, 264), (283, 120) */ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode Modified */ INPUT approaching_fast /* CIF COMMENT (879, 264), (158, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Priority to fast trains'; /* CIF DECISION (608, 414), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION passing_priority /* CIF COMMENT (848, 429), (189, 120) */ /* CIF Keep Specific Geode Font '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-bold-r-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*'*/ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Priority to fast trains ?'; /* CIF ANSWER */ /* CIF Specific Geode Position (448, 594), (150, 60) */ /* CIF Line (718, 564), (718, 579), (523, 579), (523, 594) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( fast_trains ): /* CIF TASK (423, 684), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing := passing+1; /* CIF TASK (405, 834), (237, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Priority_train_id := sender; /* CIF ProcedureCall (423, 984), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CALL Close_Gates; /* CIF OUTPUT (407, 1134), (232, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT go to Priority_train_id /* CIF COMMENT (659, 1134), (189, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Authorize this train to pass'; /* CIF OUTPUT (402, 1284), (242, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT wait to Priority_train_id /* CIF COMMENT (664, 1284), (228, 170) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Then stop the forthcoming ones when the track is free again'; /* CIF TASK (407, 1484), (232, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Priority_train_id := null; /* CIF ANSWER */ /* CIF Specific Geode Position (837, 594), (150, 60) */ /* CIF Line (718, 564), (718, 579), (912, 579), (912, 594) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ELSE: /* CIF TASK (812, 684), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK stopped := stopped +1; /* CIF End DECISION */ ENDDECISION; /* CIF NEXTSTATE (618, 1649), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Train_Pass; /* CIF ContinuousSignal (1145, 261), (285, 202) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ PROVIDED not (more_than_one) or passing_priority =all_trains /* CIF COMMENT (1461, 269), (231, 189) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Car sensor is not active anymore (or priority mode has changed)'; /* CIF DECISION (1178, 493), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION stopped /* CIF COMMENT (1418, 508), (160, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Are there some trains waiting ?'; /* CIF ANSWER */ /* CIF Specific Geode Position (1103, 673), (150, 60) */ /* CIF Line (1288, 643), (1288, 658), (1178, 658), (1178, 673) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( >0 ): /* CIF ProcedureCall (1078, 763), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CALL Close_Gates; /* CIF OUTPUT (1078, 913), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT go To *; /* CIF TASK (1054, 1063), (248, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing:= passing+stopped, stopped:=0 /* CIF COMMENT (1322, 1063), (316, 122) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Formerly stopped trains are now allowed to pass'; /* CIF NEXTSTATE (1078, 1215), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Wait_Cars; /* CIF ANSWER */ /* CIF Specific Geode Position (1323, 673), (150, 60) */ /* CIF Line (1288, 643), (1288, 658), (1398, 658), (1398, 673) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( 0 ): /* CIF NEXTSTATE (1298, 763), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Wait_train; /* CIF End DECISION */ ENDDECISION; /* CIF End STATE */ ENDSTATE; /* CIF CurrentPage Manual_control */ /* CIF STATE (54, 64), (237, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Wait_cars, Train_pass; /* CIF INPUT (59, 214), (226, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT manual_go; /* CIF RESET (72, 364), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RESET (priority_timer); /* CIF OUTPUT (72, 514), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT go TO *; /* CIF TASK (45, 664), (253, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing := passing+stopped, stopped:=0; /* CIF NEXTSTATE (53, 814), (237, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Manually_allowed; /* CIF End STATE */ ENDSTATE; /* CIF STATE (1054, 65), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Car_Pass, Wait_train; /* CIF INPUT (885, 215), (237, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT manual_open, manual_wait; /* CIF RESET (904, 365), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RESET (priority_timer); /* CIF NEXTSTATE (882, 515), (242, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Manually_stopped; /* CIF INPUT (1169, 221), (237, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT manual_close; /* CIF RESET (1188, 371), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RESET (priority_timer); /* CIF ProcedureCall (1188, 521), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CALL Close_Gates; /* CIF NEXTSTATE (1159, 671), (258, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Manually_stopped; /* CIF End STATE */ ENDSTATE; /* CIF STATE (1760, 67), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Wait_cars; /* CIF INPUT (1461, 217), (237, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT manual_close; /* CIF RESET (1480, 367), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RESET (priority_timer); /* CIF NEXTSTATE (1450, 517), (258, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Manually_allowed; /* CIF INPUT (1938, 217), (253, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT manual_wait; /* CIF RESET (1965, 367), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RESET (priority_timer); /* CIF OUTPUT (1964, 517), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT wait to *; /* CIF NEXTSTATE (1946, 667), (237, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Manually_closed; /* CIF End STATE */ ENDSTATE; /* CIF STATE (473, 60), (221, 136) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Train_Pass; /* CIF INPUT (329, 226), (237, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT manual_close; /* CIF RESET (348, 376), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RESET (priority_timer); /* CIF NEXTSTATE (318, 526), (258, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Manually_closed; /* CIF INPUT (596, 226), (253, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT manual_wait; /* CIF RESET (623, 376), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ RESET (priority_timer); /* CIF NEXTSTATE (604, 526), (237, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Manually_closed; /* CIF End STATE */ ENDSTATE; /* CIF CurrentPage Manually_stopped */ /* CIF STATE (1426, 76), (253, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Manually_stopped /* CIF COMMENT (1699, 76), (343, 120) */ /* CIF Keep Specific Geode Font '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-bold-r-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*'*/ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Trains stopped (red light) Gates closed'; /* CIF INPUT (655, 226), (269, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT Set_priority (passing_priority) /* CIF COMMENT (943, 226), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Leave manual control mode'; /* CIF DECISION (680, 376), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION passing_priority; /* CIF ANSWER */ /* CIF Specific Geode Position (175, 556), (150, 60) */ /* CIF Line (790, 526), (790, 541), (250, 541), (250, 556) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( cars ): /* CIF LABEL (150, 646), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ stopped_cars_priority: /* CIF OUTPUT (150, 796), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT open via gates; /* CIF DECISION (111, 946), (278, 184) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION more_than_one or stopped>0; /* CIF ANSWER */ /* CIF Specific Geode Position (65, 1160), (150, 60) */ /* CIF Line (250, 1130), (250, 1145), (140, 1145), (140, 1160) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF NEXTSTATE (40, 1250), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Car_Pass; /* CIF ANSWER */ /* CIF Specific Geode Position (285, 1160), (150, 60) */ /* CIF Line (250, 1130), (250, 1145), (360, 1145), (360, 1160) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF NEXTSTATE (260, 1250), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Wait_Train; /* CIF End DECISION */ ENDDECISION; /* CIF ANSWER */ /* CIF Specific Geode Position (629, 556), (176, 60) */ /* CIF Line (790, 526), (790, 541), (717, 541), (717, 556) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( all_trains, fast_trains ): /* CIF DECISION (607, 646), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION stopped > 0 /* CIF COMMENT (847, 661), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Are there some trains waiting ?'; /* CIF ANSWER */ /* CIF Specific Geode Position (532, 826), (150, 60) */ /* CIF Line (717, 796), (717, 811), (607, 811), (607, 826) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF OUTPUT (507, 916), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT go TO *; /* CIF TASK (480, 1066), (253, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing := passing+stopped, stopped:=0; /* CIF NEXTSTATE (507, 1216), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Wait_cars; /* CIF ANSWER */ /* CIF Specific Geode Position (752, 826), (150, 60) */ /* CIF Line (717, 796), (717, 811), (827, 811), (827, 826) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF NEXTSTATE (727, 916), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Wait_Train; /* CIF End DECISION */ ENDDECISION; /* CIF ANSWER */ /* CIF Specific Geode Position (1196, 556), (261, 60) */ /* CIF Line (790, 526), (790, 541), (1327, 541), (1327, 556) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( automatic_priority ): /* CIF SET (1185, 646), (285, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (NOW+Priority_time, Priority_timer); /* CIF TASK (1214, 796), (226, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Priority_level := High_Priority; /* CIF TASK (1211, 946), (232, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing_priority := cars; /* CIF JOIN (1227, 1096), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ JOIN stopped_cars_priority; /* CIF End DECISION */ ENDDECISION; /* CIF INPUT (1493, 241), (237, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT manual_open; /* CIF OUTPUT (1511, 391), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT open via gates; /* CIF NEXTSTATE (1490, 541), (242, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Manually_opened; /* CIF INPUT (1768, 239), (221, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT manual_go; /* CIF OUTPUT (1778, 389), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT go TO *; /* CIF TASK (1752, 539), (253, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing := passing+stopped, stopped:=0; /* CIF NEXTSTATE (1752, 689), (253, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Manually_allowed; /* CIF INPUT (2009, 241), (338, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT approaching_normal, approaching_fast; /* CIF TASK (2077, 391), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK stopped := stopped + 1; /* CIF NEXTSTATE (2077, 541), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF End STATE */ ENDSTATE; /* CIF CurrentPage Manually_opened */ /* CIF STATE (1323, 60), (253, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Manually_opened /* CIF COMMENT (1596, 60), (343, 120) */ /* CIF Keep Specific Geode Font '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-bold-r-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*'*/ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Trains stopped (red light) Gates opened'; /* CIF INPUT (595, 223), (269, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT Set_priority (passing_priority) /* CIF COMMENT (882, 223), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Leave manual control mode'; /* CIF DECISION (620, 373), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION passing_priority; /* CIF ANSWER */ /* CIF Specific Geode Position (175, 553), (150, 60) */ /* CIF Line (730, 523), (730, 538), (250, 538), (250, 553) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( cars ): /* CIF LABEL (150, 643), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ opened_cars_priority: /* CIF DECISION (111, 793), (278, 184) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION more_than_one or stopped>0; /* CIF ANSWER */ /* CIF Specific Geode Position (65, 1008), (150, 60) */ /* CIF Line (250, 977), (250, 992), (140, 992), (140, 1008) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF NEXTSTATE (40, 1098), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Car_Pass; /* CIF ANSWER */ /* CIF Specific Geode Position (285, 1008), (150, 60) */ /* CIF Line (250, 977), (250, 992), (360, 992), (360, 1008) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF NEXTSTATE (260, 1098), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Wait_Train; /* CIF End DECISION */ ENDDECISION; /* CIF ANSWER */ /* CIF Specific Geode Position (629, 553), (176, 60) */ /* CIF Line (730, 523), (730, 538), (717, 538), (717, 553) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( all_trains, fast_trains ): /* CIF DECISION (607, 643), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION stopped > 0 /* CIF COMMENT (847, 658), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Are there some trains waiting ?'; /* CIF ANSWER */ /* CIF Specific Geode Position (532, 823), (150, 60) */ /* CIF Line (717, 793), (717, 808), (607, 808), (607, 823) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF ProcedureCall (507, 913), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CALL close_gates; /* CIF OUTPUT (507, 1063), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT go TO *; /* CIF TASK (480, 1213), (253, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing := passing+stopped, stopped:=0; /* CIF NEXTSTATE (507, 1363), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Wait_cars; /* CIF ANSWER */ /* CIF Specific Geode Position (752, 823), (150, 60) */ /* CIF Line (717, 793), (717, 808), (827, 808), (827, 823) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF NEXTSTATE (727, 913), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Wait_Train; /* CIF End DECISION */ ENDDECISION; /* CIF ANSWER */ /* CIF Specific Geode Position (1079, 553), (261, 60) */ /* CIF Line (730, 523), (730, 538), (1210, 538), (1210, 553) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( automatic_priority ): /* CIF SET (1067, 643), (285, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (NOW+Priority_time, Priority_timer); /* CIF TASK (1096, 793), (226, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Priority_level := High_Priority; /* CIF TASK (1094, 943), (232, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing_priority := cars; /* CIF JOIN (1110, 1093), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ JOIN opened_cars_priority; /* CIF End DECISION */ ENDDECISION; /* CIF INPUT (1375, 215), (237, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT manual_close; /* CIF ProcedureCall (1394, 365), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ CALL close_gates; /* CIF NEXTSTATE (1372, 515), (242, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Manually_stopped; /* CIF INPUT (1632, 215), (338, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT approaching_normal, approaching_fast /* CIF COMMENT (1989, 215), (240, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Count how many trains are stopped'; /* CIF TASK (1700, 365), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK stopped := stopped + 1; /* CIF NEXTSTATE (1700, 515), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF End STATE */ ENDSTATE; /* CIF CurrentPage Manually_allowed */ /* CIF STATE (670, 62), (258, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Manually_allowed /* CIF COMMENT (948, 62), (311, 120) */ /* CIF Keep Specific Geode Font '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-bold-r-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*'*/ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Gates closed Trains allowed to pass (green light)'; /* CIF INPUT (40, 212), (353, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT approaching_normal, approaching_fast; /* CIF TASK (117, 362), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing := passing + 1; /* CIF NEXTSTATE (117, 512), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF INPUT (413, 212), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT leaving; /* CIF TASK (413, 362), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing := passing - 1; /* CIF NEXTSTATE (413, 512), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF INPUT (749, 212), (269, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT Set_priority (passing_priority) /* CIF COMMENT (1038, 212), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Leave manual control mode'; /* CIF DECISION (774, 362), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION passing_priority= automatic_priority; /* CIF ANSWER */ /* CIF Specific Geode Position (724, 542), (150, 60) */ /* CIF Line (884, 512), (884, 527), (799, 527), (799, 542) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF SET (656, 632), (285, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (NOW+Priority_time, Priority_timer); /* CIF TASK (685, 782), (226, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Priority_level := High_Priority; /* CIF TASK (683, 932), (232, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing_priority := cars; /* CIF ANSWER */ /* CIF Specific Geode Position (894, 542), (150, 60) */ /* CIF Line (884, 512), (884, 527), (969, 527), (969, 542) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF End DECISION */ ENDDECISION; /* CIF DECISION (773, 1097), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION passing > 0 /* CIF COMMENT (1013, 1112), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Are there some trains passing ?'; /* CIF ANSWER */ /* CIF Specific Geode Position (685, 1277), (150, 60) */ /* CIF Line (883, 1247), (883, 1262), (760, 1262), (760, 1277) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF NEXTSTATE (660, 1367), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Wait_cars; /* CIF ANSWER */ /* CIF Specific Geode Position (931, 1277), (150, 60) */ /* CIF Line (883, 1247), (883, 1262), (1006, 1262), (1006, 1277) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF OUTPUT (906, 1367), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT wait TO *; /* CIF OUTPUT (906, 1517), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT open via gates; /* CIF NEXTSTATE (906, 1667), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Wait_Train; /* CIF End DECISION */ ENDDECISION; /* CIF INPUT (1258, 212), (248, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT manual_wait; /* CIF OUTPUT (1282, 362), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT wait to *; /* CIF NEXTSTATE (1266, 512), (232, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Manually_closed; /* CIF End STATE */ ENDSTATE; /* CIF CurrentPage Manually_closed */ /* CIF STATE (1125, 84), (237, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ STATE Manually_closed /* CIF COMMENT (1382, 60), (623, 144) */ /* CIF Keep Specific Geode Font '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-bold-r-*-*-11-*-*-*-*-*-*-*' '-microsoft windows-arial-*-i-*-*-11-*-*-*-*-*-*-*'*/ /* CIF Keep Specific Geode TextMode 3 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Gates closed Waiting for the trains between the two sensors to leave to set the stopping signal (light green on certain tracks, red on others)'; /* CIF INPUT (53, 234), (460, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT approaching_normal (movement), approaching_fast (movement); /* CIF DECISION (174, 384), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION movement /* CIF COMMENT (414, 399), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'How many trains already on this track ?'; /* CIF ANSWER */ /* CIF Specific Geode Position (99, 564), (150, 60) */ /* CIF Line (284, 534), (284, 549), (174, 549), (174, 564) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( WAITING ): /* CIF TASK (74, 654), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK stopped := stopped + 1; /* CIF ANSWER */ /* CIF Specific Geode Position (319, 564), (150, 60) */ /* CIF Line (284, 534), (284, 549), (394, 549), (394, 564) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( MOVING ): /* CIF TASK (294, 654), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing:= passing+1; /* CIF End DECISION */ ENDDECISION; /* CIF NEXTSTATE (184, 819), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF INPUT (644, 234), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT leaving; /* CIF TASK (644, 384), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing:= passing-1; /* CIF DECISION (634, 534), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION passing > 0 /* CIF COMMENT (874, 549), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Are there some more trains on the tracks ?'; /* CIF ANSWER */ /* CIF Specific Geode Position (545, 714), (150, 60) */ /* CIF Line (744, 684), (744, 699), (620, 699), (620, 714) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF NEXTSTATE (520, 804), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE -; /* CIF ANSWER */ /* CIF Specific Geode Position (792, 714), (150, 60) */ /* CIF Line (744, 684), (744, 699), (867, 699), (867, 714) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF NEXTSTATE (740, 804), (253, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Manually_stopped; /* CIF End DECISION */ ENDDECISION; /* CIF INPUT (1422, 234), (269, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT Set_priority (passing_priority) /* CIF COMMENT (1711, 234), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Leave manual control mode'; /* CIF DECISION (1447, 384), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION passing_priority; /* CIF ANSWER */ /* CIF Specific Geode Position (1119, 564), (150, 60) */ /* CIF Line (1557, 534), (1557, 549), (1194, 549), (1194, 564) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( cars ): /* CIF NEXTSTATE (1094, 654), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Train_Pass; /* CIF ANSWER */ /* CIF Specific Geode Position (1335, 564), (176, 60) */ /* CIF Line (1557, 534), (1557, 549), (1423, 549), (1423, 564) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( all_trains, fast_trains ): /* CIF DECISION (1314, 654), (220, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ DECISION stopped > 0 /* CIF COMMENT (1554, 669), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ COMMENT 'Are there some train waiting ?'; /* CIF ANSWER */ /* CIF Specific Geode Position (1239, 834), (150, 60) */ /* CIF Line (1424, 804), (1424, 819), (1314, 819), (1314, 834) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( true ): /* CIF OUTPUT (1214, 924), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT go TO *; /* CIF TASK (1187, 1074), (253, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing := passing+stopped, stopped:=0; /* CIF NEXTSTATE (1214, 1224), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Wait_cars; /* CIF ANSWER */ /* CIF Specific Geode Position (1459, 834), (150, 60) */ /* CIF Line (1424, 804), (1424, 819), (1534, 819), (1534, 834) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( false ): /* CIF NEXTSTATE (1434, 924), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Wait_Cars; /* CIF End DECISION */ ENDDECISION; /* CIF ANSWER */ /* CIF Specific Geode Position (1786, 564), (261, 60) */ /* CIF Line (1557, 534), (1557, 549), (1917, 549), (1917, 564) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ ( automatic_priority ): /* CIF SET (1774, 654), (285, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ SET (NOW+Priority_time, Priority_timer); /* CIF TASK (1803, 804), (226, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK Priority_level := High_Priority; /* CIF TASK (1801, 954), (232, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing_priority := cars; /* CIF NEXTSTATE (1817, 1104), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Train_Pass; /* CIF End DECISION */ ENDDECISION; /* CIF INPUT (2090, 234), (232, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ INPUT manual_go; /* CIF OUTPUT (2106, 384), (200, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ OUTPUT go to *; /* CIF TASK (2079, 534), (253, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ TASK passing := passing+stopped, stopped:=0; /* CIF NEXTSTATE (2082, 684), (248, 120) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ NEXTSTATE Manually_allowed; /* CIF End STATE */ ENDSTATE; ENDPROCESS; /* CIF PROCESS (431, 111), (200, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF GateReference (498, 91) */ /* CIF TextPosition (0, 0) */ /* CIF Specific Geode TextName TRAIN */ /* CIF GateReference (509, 241) */ /* CIF TextPosition (0, 0) */ /* CIF Specific Geode TextName CTRL */ PROCESS Normal(1): Normal_Track; /* CIF PROCESS (745, 116), (200, 150) */ /* CIF Keep Specific Geode TextMode 4 */ /* CIF Keep Specific Geode Modified */ /* CIF GateReference (828, 96) */ /* CIF TextPosition (0, 0) */ /* CIF Specific Geode TextName TRAIN */ /* CIF GateReference (831, 246) */ /* CIF TextPosition (0, 0) */ /* CIF Specific Geode TextName CTRL */ PROCESS Fast(1): Fast_Track; ENDBLOCK; /* CIF End SYSTEMDiagram */ ENDSYSTEM;