Home | Trees | Indices | Help |
|
---|
|
object --+ | SittingCar
The class SittingCar
represents passenger cars with seats
in a train ticket reservation system. Each sitting car has rows of seats,
which are numbered starting from one upwards. Each row has a number of
seats, identified by letters starting from 'a'.
In this simple model, no data is stored about who has reserved which places (seats) in the cars. Cars only know if places are reserved or not.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
Inherited from |
|
Creates a new sitting car with the given number of seat rows, and the given number of seats per row.
|
Tells how many percent of the car's passenger places have been reserved.
|
Returns the number of seat rows in the car.
|
Returns the number of seats per row in the car.
|
Tells how many places (seats) this car has for passengers.
|
Tells how many free (unreserved) places (seats) this car has for passengers.
|
Tells if the indicated seat is reserved or not.
|
Reserves the indicated seat, if possible. The reservation is unsuccessful if the seat was already reserved.
|
Reserves places (seats) for a group. For a sitting car, a group reservation means that the whole group must get adjacent seats from the same row. Where it would be possible to make the reservation in many different ways, the smallest possible row number and first (alphabetically) possible seat identifiers are selected. If it is not possible to reserve suitable places for all members of the group, no places are reserved at all.
|
Tells if the given number of adjacent seats are free at the given location in the car.
|
Reserves the given number of adjacent seats starting at the given location in the car. Assumes that those seats really are free to begin with.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon Sep 12 17:54:04 2011 | http://epydoc.sourceforge.net |