FatmaAlsaghir /
Ferry-Transport-Simulation
Multithreaded ferry transport simulation using Java (OS project)
49/100 healthLoading repository data…
iremboyalioglu / repository
Java multithreaded ferry transport simulation using threads, semaphores, locks, conditions, FIFO queues, and runtime statistics.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A Java-based Operating Systems project that simulates a ferry transporting vehicles between two sides of a city. The project focuses on thread synchronization, mutual exclusion, FIFO queue handling, deadlock avoidance, and basic runtime statistics.
The simulation contains:
The implementation uses standard Java concurrency primitives:
Thread for vehicles and the ferrySemaphore for toll booth accessReentrantLock for shared ferry and queue stateCondition for waiting and signaling state changesBusy waiting is not used. Vehicles wait through proper synchronization mechanisms until the ferry is ready, their queue order is valid, and boarding/unloading rules are satisfied.
src/
├── Ferry.java # Ferry thread logic
├── FerrySimulation.java # Main entry point
├── Side.java # Side A / Side B enum
├── Simulation.java # Shared state, synchronization, logging, statistics
└── Vehicle.java # Vehicle thread logic
sample-output.txt # Example execution log
run.ps1 # Windows PowerShell run script
run.sh # Linux/macOS run script
mkdir out
javac -encoding UTF-8 -d out src\*.java
java -cp out FerrySimulation
or:
.\run.ps1
mkdir -p out
javac -encoding UTF-8 -d out src/*.java
java -cp out FerrySimulation
or:
chmod +x run.sh
./run.sh
The program prints timestamped events such as:
[Time 126] CAR-11 joined queue on Side B (queue length = 1)
[Time 179] Ferry loaded CAR-11 (current load = 1/20)
[Time 575] Ferry departed from Side B to Side A (load = 19, waitingA = 12, waitingB = 3)
[Time 9698] CAR-2 completed round trip (completed = 30/30)
At the end, it also prints statistics:
Vehicles completed: 30/30
Average waiting time per vehicle: ... ms
Average waiting time per boarding: ... ms
Maximum waiting time: ... ms
Number of ferry trips: ...
Ferry utilization ratio: ...
This is a small concurrency simulation intended for Operating Systems coursework and Java threading practice.
Selected from shared topics, language and repository description—not editorial ratings.
FatmaAlsaghir /
Multithreaded ferry transport simulation using Java (OS project)
49/100 healthAliAliyev0 /
A modular and thread-safe ferry transportation simulation developed in Java.
49/100 healthJalilG0 /
A high-performance, multithreaded Operating Systems simulation developed in Java, demonstrating advanced concurrency control, thread safety, and custom queue management.
ybozan /
This project simulates a ferry transportation system using multithreading in Java.
27/100 healthburceburakgazi /
Academic simulation project for an Operating Systems course, modeling vehicle transport via ferry with toll system and Java multithreading.
27/100 healthstupdhorse /
A Java-based multithreaded simulation of a ferry system transporting cars between two harbors. This project models boats, cars, and harbors using concurrency primitives such as Semaphore, Lock, and Condition to simulate real-world loading, unloading, and travel between ports.
27/100 health