Changes for page Basic design

Last modified by nfl on 2025/01/30 12:05

From version 17.1
edited by sna
on 2014/08/13 02:54
Change comment: There is no comment for this version
To version 18.1
edited by sna
on 2014/08/13 03:55
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -46,7 +46,11 @@
46 46  === Structure ===
47 47  
48 48  {{code linenumbers="true" language="sct"}}
49 -scchart Test2b "Test of IC_JCT" {
49 +//
50 +// Structure of a train controller based on test case 2
51 +//
52 +scchart Test2 "Test of IC_JCT" {
53 +  // Set of request variables for all tracks for 11 trains
50 50   bool IC_JCT_0_req[11], IC_LN_0_req[11], IC_LN_1_req[11], IC_LN_2_req[11];
51 51   bool IC_LN_3_req[11], IC_LN_4_req[11], IC_LN_5_req[11], IC_ST_0_req[11];
52 52   bool IC_ST_1_req[11], IC_ST_2_req[11], IC_ST_3_req[11], IC_ST_4_req[11];
... ... @@ -59,7 +59,9 @@
59 59   bool OC_LN_2_req[11], OC_LN_3_req[11], OC_LN_4_req[11], OC_LN_5_req[11];
60 60   bool OC_ST_0_req[11], OC_ST_1_req[11], OC_ST_2_req[11], OC_ST_3_req[11];
61 61   bool OC_ST_4_req[11], OI_LN_0_req[11], OI_LN_1_req[11], OI_LN_2_req[11];
62 - bool req_in_R, req_out_R, req_in_L, req_out_L, perm_in_R, perm_out_R, perm_in_L, perm_out_L;
66 +
67 + // Set of permission variables for all tracks
68 +  bool req_in_R, req_out_R, req_in_L, req_out_L, perm_in_R, perm_out_R, perm_in_L, perm_out_L;
63 63   int IC_JCT_0_perm, IC_LN_0_perm, IC_LN_1_perm, IC_LN_2_perm;
64 64   int IC_LN_3_perm, IC_LN_4_perm, IC_LN_5_perm, IC_ST_0_perm;
65 65   int IC_ST_1_perm, IC_ST_2_perm, IC_ST_3_perm, IC_ST_4_perm;
... ... @@ -72,11 +72,15 @@
72 72   int OC_LN_2_perm, OC_LN_3_perm, OC_LN_4_perm, OC_LN_5_perm;
73 73   int OC_ST_0_perm, OC_ST_1_perm, OC_ST_2_perm, OC_ST_3_perm;
74 74   int OC_ST_4_perm, OI_LN_0_perm, OI_LN_1_perm, OI_LN_2_perm;
75 -
81 +
82 + // Debug flag for additional output
76 76   bool debug = false;
77 - bool cleanup = false;
84 + // Cleanup flag for halting the trains at home station tracks
85 +  bool cleanup = false;
86 +  // Variable, that gives the number of trains to C-Controller for stability check
78 78   int trainCount;
79 -
88 +
89 + // Set of constants for binding to referenced SCCharts
80 80   const int c_EINS = 1;
81 81   const int c_ZWEI = 2;
82 82   const int c_DREI = 3;
... ... @@ -83,37 +83,59 @@
83 83   const int c_VIER = 4;
84 84   const int c_FUENF = 5;
85 85  
96 + // State initializing the trains on corresponding tracks
86 86   initial state init references initRailway11Trains
87 87   --> run;
88 88  
100 + // State handling the train schedules
89 89   state run {
102 + // Regions handling the mutual exclusion on the track segments
90 90   region Mutexes:
104 +  // State referenced to the MutexController for 11 Trains
91 91   initial state Mutexes references mutexRailway11Trains;
92 92  
93 93   region KH_Mutexes:
108 +  // State referenced to additional MutexController for KH
94 94   initial state KH_Mutexes references kh_mutex;
95 95  
111 + // Regions that contain the schedules for individual trains
112 + //--------------------------------------------------------------------------------------
113 +
114 + // Region with schedule for train 4
96 96   region Train4 :
116 +  // State with the schedule for train 4
97 97   initial state train4 {
98 98  
119 + // Annotation for replacing following constant in the hostcode of referenced SCChart
99 99   @alterHostcode
121 + // Number of the train for identifying on track segments
100 100   const int trainNum = 4;
123 +  // Variable specifying the track, where the train arrives at,
124 + // and for transmitting the track number to next Station-2-Station controller
101 101   int arrivalTrack = 3;
102 102  
127 + // Schedule of train 4: train drives only in the IC, should use station track 3
128 + // State Round referenced to ICIC Station-2-Station controller
103 103   initial state Round references ICIC
104 104   bind depTrack to arrivalTrack,
105 105   destTrack to c_DREI,
106 106   arrTrack to arrivalTrack
133 +  // Transition to checking state
107 107   >-> Choice;
108 -
135 +
136 + // State for checking, when the train should halt and if the train is on corresponding track
109 109   state Choice
138 + // Transition for driving additional circle, if cleanup = false or wrong track used
110 110   --> Round with !cleanup | !(arrivalTrack == 3)
140 + // Transition to final state
111 111   --> Done;
112 112  
113 - final state Done;
114 -
143 + final state Done;
115 115   };
116 - region Train5 :
145 +
146 +
147 + // Region with schedule for train 5, identical to region above
148 +  region Train5 :
117 117   initial state train5 {
118 118  
119 119   @alterHostcode
... ... @@ -134,6 +134,8 @@
134 134  
135 135   };
136 136  
169 +
170 + // Region with schedule for train 9, identical to region above
137 137   region Train9 :
138 138   initial state train9 {
139 139  
... ... @@ -153,7 +153,9 @@
153 153  
154 154   final state Done;
155 155   };
156 -
190 +
191 +
192 + // Region with schedule for train 7
157 157   region Train7 :
158 158   initial state train7 {
159 159  
... ... @@ -161,10 +161,14 @@
161 161   const int trainNum = 7;
162 162   int arrivalTrack = 1;
163 163  
200 + // Schedule of train 7: train drives from OC-Station track 1 to IC-Station track 2 and back
201 + // arrivalTrack used for transmitting the number of station track where train arrived on
202 + // to next controller where the train starts on
164 164   initial state OCtoIC references OCIC
165 165   bind depTrack to arrivalTrack,
166 166   destTrack to c_ZWEI,
167 167   arrTrack to arrivalTrack
207 +  // Transition to next Station-2-Station controller
168 168   >-> ICtoOC;
169 169  
170 170   state ICtoOC references ICOC
... ... @@ -171,10 +171,14 @@
171 171   bind depTrack to arrivalTrack,
172 172   destTrack to c_EINS,
173 173   arrTrack to arrivalTrack
214 +  // Transition to checking state because train at home station
174 174   >-> Choice;
175 175  
217 + // State for checking, when the train should halt and if the train is on corresponding track
176 176   state Choice
177 - --> OCtoIC with !cleanup | !(arrivalTrack == 1)
219 + // Transition for driving additional circle, if cleanup = false or wrong track used
220 +  --> OCtoIC with !cleanup | !(arrivalTrack == 1)
221 + // Transition to final state
178 178   --> Done;
179 179  
180 180   final state Done;
... ... @@ -280,9 +280,9 @@
280 280  
281 281  
282 282  
283 - // .....................................................................................
327 + // ----------------------------------------------------------------------------------------------------------------
284 284   // Set of track segment controlling states such as follows
285 - // .....................................................................................
329 + // ----------------------------------------------------------------------------------------------------------------
286 286  
287 287   // Transition to next track segment, if contact is triggered
288 288   state *_LN_0 {
... ... @@ -354,7 +354,7 @@
354 354   // Transition to next track segment, if contact is triggered
355 355   --> *_LN_1 with 'railContact(*_LN_1,0)';
356 356  
357 - // ..................................................................................
401 + // ----------------------------------------------------------------------------------------------------------------
358 358  
359 359  
360 360  
Confluence.Code.ConfluencePageClass[0]
Id
... ... @@ -1,1 +1,1 @@
1 -9471666
1 +9471746
URL
... ... @@ -1,1 +1,1 @@
1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/SS14Railway/pages/9471666/Basic design
1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/SS14Railway/pages/9471746/Basic design