![]() |
CSE 143 Summer 2001Homework 5Due: |
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.
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.
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.
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:
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.
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.
As this is a 1.5 week assignment, it has been split into three portions.