Individual Assignment (System) Week 12
Individual Assignment (System) Week 12
Objective:
This assignment has been designed for students to apply appropriate concurrent program
methods in implementing a concurrent program from a program specification.
Learning Outcomes
PLO2 Cognitive Skills - This relates to thinking or intellectual capabilities and the ability to apply
knowledge and skills. The capacity to develop levels of intellectual skills progressively begins
from understanding, critical/creative thinking, assessment, and applying, analysing, problem
solving as well as synthesizing to create new ideas, solutions, strategies, or new practices. Such
intellectual skills enable the learner to search and comprehend new information from different
fields of knowledge and practices.
Page 1 of 6
Concurrent Programming - CT074-3-2 Asia Pacific University of Technology & Innovation Level 2
Case Study
The Problem
This part of the assignment will require you to implement the terminal simulation, as broken
down in the sections below.
The management of an airport thinks that the way in which the airport is operated means that
incoming flights must spend too much time waiting for landing clearance. To evaluate the
situation a simulation of the airport has been commissioned. This simulation will simply run
with text output describing the events as they occur in the airport and collect a minimal
amount of statistical data.
Intention of assignment
Even if valuable to the owner, the simulation is not the main purpose of this assignment -
indeed, if this was the case there are much better techniques for simulating than writing a
concurrent program.
You have been tasked to automate the task of Air Traffic Controller (ATC). ATCs have three
main tasks as an aircraft approaches an airport, all of which must be carried out as quickly as
possible:
*******************************Basic Requirements******************************
• Ensure that the aircraft does not collide with another aircraft or any other obstacle.
• Ensure that the approaching aircraft is inserted smoothly into the traffic around the airport,
with a minimum of disruption to the flight paths of other aircraft.
• Guide the aircraft onto a runway, again with a minimum of disruption to the rest of the
traffic around the airport.
Once an aircraft obtains permission to land, it should land on the runway, coast to the
assigned gate, dock to the gate, allow passengers to disembark, refill supplies and fuel, receive
new passengers, undock, coast to the assigned runway and take-off.
A congested scenario should be simulated where planes are waiting to land while the 2 gates
are occupied.
As the airport is small, there is no waiting area on the ground for the planes to wait for a gate
to become available.
Page 2 of 6
Concurrent Programming - CT074-3-2 Asia Pacific University of Technology & Innovation Level 2
*****************************Additional Requirements****************************
Special cases, such as aircraft experiencing fuel shortages, must be dealt with.
- Passengers disembarking/embarking
- Refuelling of aircraft
The Statistics
At the end of the simulation, i.e., when all other processes have terminated cleanly, the ATC
manager should do some sanity checks of the airport and print out some statistics on the run.
The result of the sanity checks must be printed. You must
Page 3 of 6
Concurrent Programming - CT074-3-2 Asia Pacific University of Technology & Innovation Level 2
Deliverables:
For this exercise, you are to model the ATC scenario and design a Java program to simulate
activity for the airport:
• Assume passengers are always ready to embark and disembark the terminal (i.e., no
capacity issues inside the passenger terminals)
Sample Output
In order to see what is happening dynamically you must have output from the passengers, the
air traffic controller, and the pilots reporting all their major events.
Add information about which process/thread is doing the output. This way you can see if a
process/thread acts for another, which is strictly forbidden, but is a common error for Java
solutions (objects are not processes!). An example of such incorrect behaviour is
Thread-ATC : 21.31: Plane 5: Requesting permission to land!
main : 21.50: ATC: Please wait and join the circle queue.
Thread-Passenger-8 : 21.50: I’m boarding Plane 2 now.
Where you can see that not only the ATC thread but also the main thread is acting for the ATC.
• Kill a thread or process. You may not use any of the following primitives in Java:
o Thread.stop
o Thread.resume
o Thread.suspend
o Thread.interrupt
You may not use the destroy or stop(0) primitives in - except to take care of temporary
resources like simple timers.
• Solve the last orders problem in a manner forbidden in the description above.
Page 4 of 6
Concurrent Programming - CT074-3-2 Asia Pacific University of Technology & Innovation Level 2
Implementation
Page 5 of 6
Concurrent Programming - CT074-3-2 Asia Pacific University of Technology & Innovation Level 2
Page 6 of 6