CSE 143 Summer 2001

Homework 5

Due:
Part I: paper receipt due in section on Tuesday, Aug 7.
Part II: electronic submission 9:30 pm, Monday, Aug 13.
Part II: paper receipt due in section on Tuesday, Aug 14.
In addition, you will meet with your TA the week of 8/13 - 8/17 to demo your project.


Overview

In this assignment, you will create a simulation for an air-traffic control system.

You may work with a partner if you want. If you do, you and your partner should turn in only one copy of your program. However, both you and your partner are responsible for being able to explain everything in your code! You may choose a partner from any student in the course, not just students in your own quiz section.

Concepts

The purpose of this assignment is to gain experience with the following new concepts:

This project is very open-ended. There are some minimum requirements, which are described below. But you are encouraged to use your imagination and creativity to produce a realistic air-traffic simulation (with realistic graphics!). A small amount of extra credit will be awarded based on the quality and amount of additional features implemented.

Program Specification

This program simulates an air traffic control system. Starter code has been provided, and you will add to it to complete the assignment.  In addition, we will continue to use GP142 for the graphics and user interface.  

In this assignment you will simulate the operation of airspace surrounding an airport and play the part of an air traffic controller.  Simulations generally operate by breaking time into small discrete units (like seconds) and performing certain operations at each "slice" of time.  In our case, movement of airplanes will be simulated, so that at each time step:

In addition, the program will contain a user interface (menu buttons and other mouse clicks), which will allow the user to:

NOTE: To simplify things, we will assume our simulation is running in two dimensions,  i.e. all aircraft fly in the x/y plane.  We will assume that when planes reach their destination, they automatically land or leave the airspace. 

Implementation Requirements

The simulation section of the program will consist of four main data types: Aircraft, AircraftList, Simulator, and ATCUI (air traffic controller user interface).  

--The Aircraft class represents an abstract base class for all individual objects in our airspace.  At a minimum, each aircraft should possess a position, destination, and flight number.   The class should also contain pure virtual move and draw functions.   The move function should update the aircraft's position based upon its current position and its destination.  The draw function should contain all GP142 code necessary to draw your object.  Note: The demo writes additional data next to each plane for the user's reference.  This is not required, however it is quite useful for debugging. You must create at least one class derived from Aircraft to represent your actual planes, e.g. JumboJet, Fighter, UFO, etc.  

--The AircraftList class should be a linked list of Aircraft. The starter code implements a skeleton of this linked list data structure, but you will have to implement most of it yourself.

--The main class in our program will be the Simulator.  This class should contain at least the following data member and functionality:

At the beginning of each time step, you should move (update its position) each aircraft in the planeListaircrafts list. In addition, an Aircraft should be added to the list with random frequency.  (Note: The user should be able to adjust this frequency via the user interface).  If a plane reaches its destination in a given time step, then it should be removed from the planeListaircrafts list. When all aircraft have been appropriately updated, the given time step ends. As this process is repeated indefinitely, the simulation progresses.

--The ATCUI (air traffic controller user interface) class will represent all the functionality in your user interface.  The user will interact directly with the ATCUI class through buttons, other mouse clicks, etc.  The ATCUI class will then convey this information to the Simulator class.  The ATCUI object should call the appropriate methods for handling:

Program Extensions

In previous assignments there was only one extra credit point assigned for additional work.  In this assignment, up to 3 extra credit points can be obtained by adding new and interesting features to your code.  Some possible examples are:

The bottom line is, be creative and have fun!  There are many ways to extend the project far beyond the few listed above. 

Download Files

The files for this assignment are available in several formats: a self extracting zip file containing only the source files (for those using Windows), and the individual source files as plain text (for other OSs).  There is also a partial sample program offering an overview of how the program might operate. The partial sample program is not complete, it is only meant to give you one idea of how the program might work. Your program might look quite different with differnt functionality! Be creative!

Sample Program

Starter Files

NOTE: The starter code is intended to help you get started on the project, it is not meant to confine your implementation.  Feel free to change variable names, structure, etc. of the code as you see fit.  In fact, you will almost certainly have to change methods, parameters, etc. to appropriately implement the required functionality! The only stipulation is that your program meets the requirements as explained above.

The starter code provides header files defining some of the functionality for the program.  You should modify these files as necessary, as well as create the accompanying .cpp files.  In addition you will need to create your own .cpp and .h files for additional classes that you create.

What to Hand In

As this is a 1.5 week assignment, it has been split into three portions.

  1. Part I:  due Tuesday, Aug 7 in section.  By this date you should have the architecture for your program completely determined.  All of your classes and their respective methods and member variables should be defined.  You do not need to have the implementation of these classes anywhere near finished at this point, though you should have the architecture completed.  You will turnin printouts of all .h files in sections and a brief (1 page or less) report describing your architecture in words.  This will be graded on a credit/no-credit basis.  You must turnin a workable architecture, as demonstrated in your .h files and report, to receive credit 
  2. Part II:  full program due Monday, Aug 13, 9:30 PM.  The program should be turned-in electronically via the turnin page.  Print out the receipt, and add to it both a brief final report in the same format as previous assignments and also a description of any extra credit you attempted.  Staple everything, and bring it with you to section on Tuesday Aug 14.  
  3. During the week of Aug 13-17, you and your partner should schedule a face to face demo with your TA.  NOTE: If you and your partner are in different sections, choose one TA to demo with and turn in all of your written work to only that TA (but make sure you inform the other TA of your situation).  Details for scheduling demos will be announced in sections, but you must work out a time with your TA and show up. TAs may not grade projects for which students failed to show up to the meeting.