In this project, we are trying to code trains running in a railway section using concurrent programming. In this model, each railway begins and ends with a train station. Between the stations are sections that trains can pass through. Only one train can pass through each section at a time, and all running trains need to be following the same direction of movement (either left to right or right to left). Many trains cen be in the same train station however, but the maximum number of trains is fixed by the train's station maximum capacity.
To actrivate the simulation, first clone the project from Github using this command: git clone https://github.com/slach31/conc_trains Import the project on your IDE's workspace. Now you can simulate your concurrent trains, to do so open the train package and run the main file. You can see that stations, sections, railways and trains are already created and their values are set by default, if you want to change their values and try a simulation with a different number of elements, you can do so by editing the class main.
This project is developed by Othmane EL AKRABA and Soufiane LACHGUER, for a university project related to petri nets. It uses Java 23.0.1. Files are shared via Github. If you encounter any technical problems regarding this project, you can write to us at [email protected] or at [email protected]
This image shows the class diagramm obtained at the development stage :