Concurrent Systems Actor-Based Design Project

TSA Airport Screening

Introduction

For this project you will model a simplified airport security system. Passengers enter at the document check station. Passenger's with document problems are turned away, those with proper documents are assigned to the queue for one of N lines in cyclic order (0, …, N-1, 0, ….).

On entering a queue, a passenger places his or her baggage on the conveyor belt leading to the baggage scanner. When the body scanner is ready, the passenger at the head of the queue enters the body scanner; once the body scan is done, the next passenger in the queue can enter the scanner, or if no one is waiting, the scanner is marked ready.

Each scanner (body and bag) sends a report to the security station associated with the line; each report contains the passenger information and an indication as to whether the baggage or passenger passed the scan.

Once both reports for a passenger arrive at the security station, the passenger is either cleared and exits the system, or is held in a jail common to all lines for later processing. For our purposes, a passenger is cleared if and only iff both scan reports register passed.

At the beginning of the day, the system starts with an empty jail, empty queues, and turning on all of the scanners. At the end of the day, the system will close down by shutting off all of the scanners, and transporting anyone in jail to a more permanent detention center.

Diagram

The following diagram shows the general organization of the system.

TSA system diagram

System Requirements

  1. General
    1. At the beginning of the day, the system will initialize and turn on all of the scanners.
    2. At the end of the day, the system closes by turning off all the scanners, and sending prisoners in jail to permanent detention facilities. As passengers and their bags clear through the system, it will shutdown, i.e. the queue must be empty and the body scanner must be ready before the body scanner is turned off.
  2. Passengers
    1. Passengers enter the system from a main driver program.
    2. Passengers are randomly turned away for document problems at a probability of 20%.
    3. Passengers not turned away enter the queue for one of the lines in a cyclic fashion.
    4. Passengers can go to the body scanner only when it is ready.
    5. Passengers place their baggage in the baggage scanner as soon as they enter a queue.
    6. If a passenger and his or her baggage are both passed, the passenger leaves the system. Otherwise, the passenger goes to jail.
  3. Queue
    1. Each queue is identified with the line it is in.
  4. Baggage Scan
    1. Each baggage scanner is identified with the line it is in.
    2. Baggage randomly fails inspection with a probability of 20%.
  5. Body Scan
    1. Each body scanner is identified with the line it is in.
    2. Passengers randomly fail inspection with a probability of 20%.
  6. Security Station
    1. Each security station is identified with the line it is in.
    2. The security station must be prepared to have either the body scanner or the baggage scanner get ahead of the other by an arbitrary amount - that is, it must remember results until both scan reports for a passenger arrive.
    3. The security station cannot close until both of the scanners attached have turned off.
  7. Jail
    1. The jail knows how many security stations feed it passengers as prisoners.
    2. The jail will hold all prisoners until the end of the day when all prisoners in holding are sent to permanent detention.

Non-functional Requirements

  1. You must use an actor-based design for this system.
  2. All message should be immutable.

System Output

  1. A line is printed every time a message is sent. This will include the sending actor's identity, the message’s identifying information, and an indication of the destination.
  2. A line is printed every time a message is received and every time the message is processed.
  3. All printed lines must include the identity of the actor and relevant information about the actor’s actions.
  4. On receiving a message, an actor prints its name (including line index if appropriate), the message type (and content if appropriate), and the fact that this is a received message. This includes printing information about starting up and shuting down the system.
  5. A passenger turned away at the document check has a line printed to this effect. Such passengers are never passed to a queue.
  6. A passenger passing the security check has a line printed stating that the passenger left the security area.
  7. A passenger who is incarcerated has a line printed on entry to the jail, and when transferred to permanent detention at the end of the day.

Tips

  1. Construct the system from back to front, i.e. from jail to document check. This will make it easier to construct each piece with its successor piece(s).
  2. Construct each line (from queue to security station) as a unit, and when all lines are created, pass these in a collection of some kind to the document check.
  3. Be sure account for the fact that 0 or more passengers may be in a given line’s queue waiting their turn at the body scanner. If the body scanner is busy or passengers are waiting when the system is shuting down at the end of the day, these passengers must be processed before the queue and its associated scanners can be shutdown.

Bonus Credit

We have gone through examples of the AKKA framework for actors implemented in Java. This framework is also available in Scala. Teams can choose to do their project implementation in Scala for bonus credit of 15% of the grade you receive on the project. Project 2 is worth 15 points in your final grade, so if you have a perfect project, the Scala bonus would be an addition of 2.25 points in your final grade.

Discussion Forum

A discussion forum, Project 2 - TSA Screening, has been created for this project. Post any questions or comments you have to this forum, and your instructor will respond with clarifications and examples.

Submission

There will be two submissions for this project.

  1. The first submission will be a description of your actor-based design. Use the actor-based design document template to describe your design similar to what was done in the actor-based design class exercise. Deposit this single Word document in the TSA Screening Design dropbox in myCourses.
  2. The second submission will be the working implementation of this system. Submit your team's solution to the Project 2 - TSA Screening dropbox by due date and time shown in the course schedule. The submission is to consist of one ZIP file, tsa.zip, containing the following:

Credit will be deducted for submissions that do not follow the submission instructions given above.
Page revised: $Date$