This race simulation was written in java and only uses semaphores.
There are three obstacles:
- Forest: Each racer will search for a map in a forest.
- Mountain: There is only one path through the mountain (meaning only one racer can go through the path).
- River: Only groups of N_racers can swim through the river.
All racers will rest before the race and in between obstacles. The race sequence will be the following:
- Rest
- Forest
- Rest
- Mountain
- Rest
- River
At the end of the race, the judge will display the total time it took for the racer to finish the race. Each racer will wait for its friend to finish the race and they will go home together. If the racer's friend has finished the race, the racer will go home alone.