Java代写 | CSSE2002/7023 Assignment 2


In this assignment you will nish building a simple simulation of an air trac control (ATC)
In the rst assignment you implemented the core model for the ATC. In the second assignment
you will implement some of the more advanced logic to provide a very simple simulation for the
In this assignment, aircraft queues will be introduced. There are two types of aircraft queue;
a landing queue and a takeo queue. Aircraft can be added or removed from queues. It is also
possible to check if an aircraft is in a queue, and to retrieve a list of all aircraft in the queue in
A control tower was introduced in the rst assignment, but it had limited functionality. This
will now be expanded. A control tower can undertake actions such as trying to land or takeo
aircraft, and placing aircraft in queues. The functionality for nding unoccupied gates will also be
expanded from the rst assignment.

A control tower initialiser is also introduced in this assignment. The purpose of this is primarily
to load information from 4 data les (which store information about aircraft and their tasks,
terminals and gates, queues, and the number of ticks elapsed) into the ATC model when the
program starts. This information will allow the simulation to be run, and for aircraft to move
between various tasks.
Passenger and freight aircraft will now also have the ability to unload their passengers or cargo.
Multiple entities within the ATC now have the option to be encoded, and have hashcode and/or
equals methods.
A simple GUI has been provided to you as part of the provided code. It is in the towersim.display
package. It will not work until you have implemented the other parts of the assignment that it uses.
The GUI has been implemented using JavaFX and consists of three classes. View creates the
main window for the ATC GUI. AirportCanvas displays the structure of the airport. ViewModel
represents the ATC model that is to be displayed. The ATC application is initialised and started
by the Launcher class in the towersim package. It loads the tick, aircraft, queue, and terminals
and gates data and creates the GUI. Most of the GUI code has been provided to you.
In ViewModel you need to implement some of the logic that is executed by events in the simu-
lation when buttons are pressed, and to save information in the ATC model to data les.
The functionality you need to implement in ViewModel is to:
De nes what happens when the “Drone Alert” button is clicked.
Declares a state of emergency on all terminals managed by the control tower.
De nes what happens when the “Clear Drone Alert” button is clicked.
Clears the state of emergency on all terminals managed by the control tower.
De nes what happens when the “Find Gate for Selected Aircraft” button is clicked.
Updates information onscreen with the gate found for the currently selected aircraft.
Saves the current state of the control tower simulation (which could then be loaded etc.).

Persistent Data & Loading Data from Files
Loading Data Files:
You need to implement loading the following from data les:
 The number of ticks elapsed.
The JavaDoc for the loadTick method in the ControlTowerInitialiser class describes
the format of a tick data le.
 Aircraft information.
The JavaDoc for the loadAircraft method in the ControlTowerInitialiser class
describes the format of an aircraft data le.
 Queue information.
The JavaDoc for the loadQueues method in the ControlTowerInitialiser class de-
scribes the format of a queue data le.
 Terminals and gates information.
The JavaDoc for the loadTerminalsWithGates method in the ControlTowerInitialiser
class describes the format of a terminals and gates data le.

Example Data Files:
The following data les are provided. These show the default le implementations (when no
information has been added).
 aircraft default.txt
 queues default.txt
 terminalsWithGates default.txt
 tick default.txt
The following data les are provided. These show basic implementations of the data les. Note
that data les can contain more, or di erent information.
 aircraft basic.txt
 queues basic.txt
 terminalsWithGates basic.txt
 tick basic.txt



本网站支持淘宝 支付宝 微信支付  paypal等等交易。如果不放心可以用淘宝交易!

E-mail:  微信:itcsdx