THE UNIVERSITY OF WESTERN AUSTRALIA

Department of Computer Science

230.304 CONCURRENT PROGRAMMING

Concurrent Programming Project (2000)

Simulating a Railway Network (Due Date : Midnight, 31st May, 2000)

Submit to : /cslinux/marking/cs304

The Concurrent City Railway Network is a simple railway network consisting of four railway tracks. Two parallel tracks are from east to west (Tracks A and B) and the other two parallel tracks are from north to south (tracks X and Y).

                              X          Y  
                               o          o 
                               |          |
                               |          |  
                        A  o---o----o-----o----o 
                               |          |   
                               o          o  
                               |          | 
                        B  o---o----o-----o----o 
                               |          |   
                               |          |  
                               o          o 

There are five stations on each of the tracks. The small circles on the tracks in the picture above are the stations. The stations on the X and Y tracks are numbered from 1 to 5. For example, the stations on the X track are numbered X1, X2, X3, X4 and X5 from north to south. Similarly, the stations on the A and B tracks are numbered from west to east. If a station is common to two tracks, it is called a junction. For example the station X2 or A2 is a junction on the A and X tracks. Each station can accommodate at most 15 passengers.

There is a train dedicated to each track. The train for a particular track goes up and down the track stopping at each station. A train can accommodate up to 20 passengers at a time.

The project

The project is to simulate this network. The simulation starts with each station having 15 passengers and each passenger has a random destination station. Hence, it may be necessary for a passenger to change her/his train for reaching her/his destination. The simulation ends when all the passengers have reached their destinations. The tasks in the project can be broadly divided into two categories.

Some more specifications

Amitava Datta
April, 2000