15.3 Behaviors of the objects

The top-level function of our application is called process-aircraft. Given an airport that has been properly initialized, process-aircraft will simulate and document the movement of all inbound aircraft through all the containers of the airport, from landing through takeoff.

To predict how long it will take for an aircraft to arrive at the airport, we need to compute the distance between the position of the aircraft and the position of the airport. Then, we must divide the distance by the speed to determine how long it will take the aircraft to get from one position to the other. The flying-time method will implement that computation in our design.

Once an aircraft approaches the airport, it enters a series of containers. The generic functions that constitute the vehicle-storage protocol help us to generate and simulate the transitions of the aircraft from container to container.

We summarize some of the operations in our design here; we summarize the vehicle-storage protocol in Section 15.4.

process-aircraft airport time

Generic Function

This generic function simulates and documents the movement of aircraft through the airport, including the time of each transition — for example,

12:30: Aircraft Cardinal at Runway 11R-29L
12:43: Aircraft Cardinal at Taxiway Echo
12:47: Aircraft Cardinal at Gate A2

The airport is an instance of <airport>. The time is an instance of <time-of-day>.

distance-3d aircraft airport

Generic Function

This generic function returns the distance between its two arguments. The aircraft is an instance of <aircraft>, and the airport is an instance of <airport>.

flying-time aircraft airport

Generic Function

This generic function returns the time that it would take for the aircraft to fly to the airport.