15.4 The vehicle-container protocol
Once the aircraft approaches the airport, it enters a set of connected containers on its way inbound to a particular gate. The aircraft eventually turns around and heads outbound toward the sky. The vehicle-container protocol manages the transition of aircraft from one container to another. The generic functions that make up this protocol are summarized next. For all the generic functions that follow, the value of the vehicle parameter must be an instance of <vehicle>, the value of the container parameter must be an instance of <vehicle-storage>, and the value of the direction parameter must be either the symbol #"inbound" or #"outbound".
Generic Function
This generic function returns true if there is space in container for vehicle to enter for traveling in direction.
move-in-vehicle vehicle container directionGeneric Function
This generic function moves the vehicle into the container in the direction given.
move-out-vehicle vehicle container directionGeneric Function
This generic function moves the vehicle out of the container in the direction given.
next-out container directionGeneric Function
This generic function determines what vehicle, if any, could move to the next container. If there is such a vehicle, then next-out returns the vehicle, the next container in the direction of travel, and the time it would take to make that transition.
Generic Function
This generic function returns two values. The first value is the class of the next container into which vehicle may move from container. The second value is how long it will take vehicle to move into the next container. This generic function is used by the next-out generic function to accomplish part of the latter's work.




