forked from steger/pr3-ws202526
63 lines
4.4 KiB
Markdown
63 lines
4.4 KiB
Markdown
# Assignment - Airport Simulation
|
|
This go-program is a simulation of the departure process of an airport that consists of *aircrafts*, *passengers*, *checkin-counter*, *security-checks*, *gates*, a *baggage handling system*, a *runway*, a *flight schedule* and *gates*. Passengers go through the following steps:
|
|
- **Checkin**: The ticket is verified, baggage is checked in and handed over to the baggage handling system, and a boarding pass is issued.
|
|
- **Security-Check**: The boarding pass is verified and the passenger is checked for prohibited items.
|
|
- **Gate**: The passenger walks to the correct gate and waits there until boarding time. The gate takes then care of boarding the aircraft, while simultaneously loading baggage into the aircraft.
|
|
|
|
Each step has a processing time and there are several waiting times in between.
|
|
|
|
Aircrafts arrive at the gate on boarding time and leave to the runway on departure time according to the flight schedule.
|
|
|
|
## Task
|
|
|
|
Your task is to complete the implementation by going through the **TODO** statements in the files `baggageHandlingSystem.go`, `securityCheck.go`, and `gate.go`. All other files already contain an implementation.
|
|
|
|
**Hint**: The expected behavior is defined in detail in the corresponding unit tests.
|
|
|
|
**Hint**: Be aware of synchronization issues between the different goroutines for all actors. Use `channels` whenever applicable. See `checkin.go` for inspiration.
|
|
|
|
## Example Output
|
|
|
|
```
|
|
Flight Number Destination Gate Boarding Time Departure Time
|
|
--------------------------------------------------------------------------------
|
|
AF2062 ZAG 7 13:59:27 13:59:57
|
|
BA8851 SOF 9 13:59:47 14:00:17
|
|
SK4243 FRA 5 14:01:46 14:02:16
|
|
KL5728 WAW 9 14:03:06 14:03:36
|
|
SK8183 PRG 8 14:03:12 14:03:42
|
|
AF8488 LIS 5 13:59:45 14:00:15
|
|
KL5937 RIX 1 14:01:26 14:01:56
|
|
AY1065 BRU 7 14:00:37 14:01:07
|
|
BA1529 ZRH 5 14:02:03 14:02:33
|
|
IB2405 IST 3 14:01:51 14:02:21
|
|
What/Who arrives at airport? (p for passenger, c for car, t for train, q to quit): p
|
|
stoic_dijkstra has arrived at the airport for the flight number IB2405 to IST in 3.11 minutes with 2 bags and carry-on items: [Medicine Knife Sharpener]
|
|
stoic_dijkstra completed the checkin procedure and is now heading to security
|
|
stoic_dijkstra has successfully passed the security check and is now walking to the gate
|
|
elated_hellman has arrived at the airport for the flight number KL5728 to WAW in 4.19 minutes with 2 bags and carry-on items: [Explosives]
|
|
vibrant_maxwell has arrived at the airport for the flight number BA8851 to SOF in 0.88 minutes with 2 bags and carry-on items: [Keys Matches]
|
|
dazzling_lewin has arrived at the airport for the flight number AF2062 to ZAG in 0.54 minutes with 1 bags and carry-on items: []
|
|
nifty_hermann has arrived at the airport for the flight number IB2405 to IST in 2.94 minutes with 1 bags and carry-on items: [Resistance Bands Gloves]
|
|
elated_hellman completed the checkin procedure and is now heading to security
|
|
vibrant_maxwell completed the checkin procedure and is now heading to security
|
|
elated_hellman: prohibited item detected: [Explosives]
|
|
flight AF2062 is ready for boarding
|
|
dazzling_lewin completed the checkin procedure and is now heading to security
|
|
vibrant_maxwell has successfully passed the security check and is now walking to the gate
|
|
nifty_hermann completed the checkin procedure and is now heading to security
|
|
dazzling_lewin has successfully passed the security check and is now walking to the gate
|
|
nifty_hermann has successfully passed the security check and is now walking to the gate
|
|
dazzling_lewin has successfully boarded flight AF2062 to ZAG
|
|
flight AF8488 is ready for boarding
|
|
flight BA8851 is ready for boarding
|
|
loaded baggage {[Goggles Fire Extinguisher Controller]} onto flight BA8851
|
|
loaded baggage {[Book Clipboard]} onto flight BA8851
|
|
vibrant_maxwell has successfully boarded flight BA8851 to SOF
|
|
boarding completed for flight number AF2062
|
|
Flight AF2062 is waiting for takeoff
|
|
Flight AF2062 to ZAG is taking off
|
|
Flight AF2062 to ZAG has taken off with 1 passengers and 0 bags on board
|
|
Closing airport
|
|
The following baggage was lost today: []
|
|
``` |