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! Define your project goals! Therefore...
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. 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! |
The following goals should definitely be reached (if we get modules in Kieler):
In addition, the following optional goals might be reached, if there is enough time:
Trains should drive slowly at the points
13.5. Presentation 27.5. Station-Station Controller + C-Interface 17.6. Integrationstesting 24.6. Defined testcases with stopflag 01.7. Schedules for trains are working cw 34 Final presentation 28.08 Excursion to Miniatur Wunderland |
Task | Assigned Persons |
---|---|
C-Inteface | Alexander |
Mutual Exclusion | Nis |
Station-to-Station | Personal assignments |
Test Scenarios | Expert-groups |
Deadlocks | Carsten |
Integration | Small groups, dynamic time schedule |
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 and 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 exits of all train stations, and additionally, if one train with a low priority exits 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.
Basic Track:
The behaviours of a basic track is described as follows:
Sample Pass for one Track (in pseudocode)
scchart Default_Pass { bool perm_next_Segment; initial state prev --> Gleissegment with 'contact(Segment,0)'; state Gleissegment { entry / 'req(next_Segment)'; entry / 'setSignal(prevSegment, red)'; initial state Entry --> Continue with 'contact(Segment,0)' & perm_next_Segment --> Slowdown with 'contact(Segment,0)'; state Slowdown { entry / 'setSpeed(Segment,SLOW)'; } --> Waiting with 'contact(Segment,1)' --> Continue with perm_next_Segment; state Waiting { entry / 'setSpeed(Segment,BRAKE)'; } --> Continue with perm_next_Segment; state Continue { entry / 'setSignal(Segment,green)'; entry / 'setSpeed(Segment,full)'; entry / 'setSpeed(nextSegment,full)'; entry / 'setSignal(nextSegment, red)'; } --> leave immediate; final state leave; region: initial state Entry --> cleanup with 'contact(Segment, 0)'; state cleanup { entry / 'free(prevSegment)'; entry / 'setSpeed(prevSegment,OFF)'; } --> done immediate; final state done; } >-> next with 'contact(nextSegment, 0)'; state next; } |
Behaviour modeled in an SCChart (without deadlock prevention):
Station-Station Modules
Input: train number, departure track, destination track, Cleanup flag, (mutex variables necessary?)
Output: "real" destination track (alternative destination track)
Modules needed:
Example for track segment requests (with 2 trains):
C-Interface
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. To bring in some randomness, the time, which a train has to wait in a station, is controlled by the C-Interface. Therefore, trains have to notify the interface about their arrival and their departure.
Test cases:
Our Implementation should pass the following simple tests:
Meetings: Every Wednesday at 4 pm.