Wiki source code of Project goals

Version 9.1 by cbu on 2014/05/12 21:16

Show last authors
1 {{info title="DEADLINE 13.05."}}
2 At the end of this summer term a railway controller modelled in SCCharts should exist that is able to //control// the model railway installation. What exactly //control// means is up to you!
3
4 Define your project goals! Therefore...
5
6 * Define the desired capabilities of your controller.
7 * Devide your project in several subprojects. Organize the whole team in subteams and determine who is responsible for what.
8 * Define interfaces between the subteams and/or components the subteams are responsible of.
9 * Create a detailed roadmap with milestones for each subproject.
10
11 You are going to present your plan in a short presentation (latex beamer preferred) in the following week, 13.05. 12:30. The presentation should last 30 min.
12
13 Remember, you are going to present your controller at the end of the summer term! Getting this task done right is a very important step to succeed with your controller and this project!
14 {{/info}}
15
16
17
18 **The following goals should definitely be reached (if we get modules in Kieler):**
19
20 * At least 5 trains can drive on the track at the same time
21 * A "cleanup" function for trains should drive all trains to their original position
22 * Our test scenarios should work (see Test-Scenarios)
23 * The trains slow down before braking
24 * All signals are working correctly
25 * Gates should close, when a train is coming, and open again afterwards
26
27 **In addition, the following optional goals might be reached, if there is enough time:**
28
29 * Deadlock avoidance: Trains should never run into a deadlock
30 * Cleanup function: All Trains which are still on the track travel to their next destination and afterwards they take the shortest way home
31 * (((
32 Trains should drive slowly at the points
33 )))
34
35 **Road Map:**
36
37 {{code}}
38 13.5. Presentation
39 27.5. Station-Station Controller + C-Interface
40 17.6. Integrationstesting
41 24.6. Defined testcases with stopflag
42 01.7. Schedules for trains are working
43
44 cw 34 Final presentation
45 cw 35 Excursion to Miniatur Wunderland
46 {{/code}}
47
48 **
49 **
50
51 **Work distribution: **
52
53 **
54 **
55
56 **Implementation in short:**
57
58 The main idea is, that we have a universal model of the track segments. From these single track segments, track sections, that connect train stations are modeled and from those track sections, all final schedules for the trains should be build. On each track segment, there should be at most one train: In order to drive over a track, a train must request this track, and afterwards it must free it again (details below). If two trains request the same track section, the priority, which is derived from the train number, decides, which train gets the track section. A train must request all tracks until the next possibility to stop an wait in order to avoid collisions. If the train does not get all track segments, it must free them again in order to avoid deadlocks or delays of other trains. Deadlocks might occur at the exists of all train stations, and additionally, if one train with a low priority exists the Kicking-Horse-path while another train with a higher priority sends an entry-request. It remains to be seen, if additional deadlocks occur. Deadlocks can be resolved by using a superior Mutex-Controller.
59
60 === **Implementation in detail:** ===
61
62 **Basic Track:**
63
64 The behaviours of a basic track is described as follows:
65
66 **Sample Pass for one Track (in pseudocode)**
67
68 {{code linenumbers="true"}}
69 state Foo
70 --> Gleissegment with contact(Segment,0)
71 state Gleissegment {
72 entry / req(next_Segment);
73 entry / setSignal(prevSegment, red);
74
75 inital state Entry
76 --> Continue with contact(Segment,0) & perm_next_Segment
77 --> Slowdown with contact(Segment,0);
78
79 state Slowdown {
80 entry / setSpeed(Segment,SLOW);
81 } --> Waiting with contact(Segment,1)
82 --> Continue with perm_next_Segment;
83
84 state Waiting {
85 entry / setSpeed(Segment,BRAKE);
86 } --> Continue with perm_next_Segment;
87
88 state Continue {
89 entry / setSignal(Segment,green);
90 entry / setSpeed(Segment,full);
91 entry / setSpeed(nextSegment,full);
92 entry / setSignal(nextSegment, red);
93 entry / free(prevSegment)
94 entry / setSpeed(prevSegment,OFF);
95 }--> leave immediate;
96
97 final state leave;
98 }
99 {{/code}}
100
101 Behaviour modeled in an SCChart (without deadlock prevention):
102
103 [[image:attach:csp_default_pass.png]]
104
105 === Station-Station Modules ===
106
107 Input: Zugnummer, Startgleis, Zielgleis, Cleanup, (Mutex Variablen?)
108 Output: "Echtes" Zielgleis (Ausweichgleis?)
109
110 Modules needed:
111
112 * KH-KH
113 * KH-KH (other way round)
114 * KH-IC
115 * IC-KH
116 * KH-OC
117 * OC-KH
118 * IC-IC
119 * IC-OC
120 * OC-IC
121 * OC-OC
122
123
124
125 **Example for track segment requests (with 2 trains):**
126
127 === [[image:attach:nbw-mutex-sct.png]] ===
128
129 === C-Interface ===
130
131 The C-Interface wraps some general functions, in order to prevent long and ugly host-code statements within the SCCharts. It especially hides the railway pointer. In addition, the C-Interface provides a persistent environment during a macro step.
132
133
134
135 **Test cases: **
136
137 Our Implementation should pass the following simple tests:
138
139 1. 3 trains travel from KH-Station to KH-Station in the main travel direction and 2 trains travel from KH-Station to KH-Station into the other direction. A possible problem might be the KH-Pass.
140 1. 3 trains travel from IC-Station to IC-Station and 1 train travels from OC-Station via IC-Station to OC-Station. This test case tests the behavior of the IC_JCT.
141 1. 3 trains travel from OC-Station to OC-Station and 1 train travels from IC-Station via OC-Station to IC-Station. This test case tests the behavior of the OC_JCT.
142 1. 2 trains travel from IC-Station to IC-Station and 2 trains travel from OC-Station to OC-Station and 1 train travels from KH-Station via IC-Station to KH-Station. The problem here might arise from KIO_LN to IC_ST and from IC_ST to KIO_LN.
143 1. Cleanup
144
145
146
147 == Organization ==
148
149 Meetings: Every Wednesday at 4 pm.
150
151