Home | Trees | Indices | Help |
|
---|
|
object --+ | Excursion
The class Excursion
represents excursions that students
can sign up for. Each excursion object has a maximum number of
"places" for students, a name and a sequence number which
indicates if the excursion is a "re-run" of a previous one. An
excursion object keeps track of which students have signed up for the
excursion. There may be more students signed up for an excursion than
there are places, in the hopes that places are freed by cancellations or
more places are added to the excursion. Such students are called
"reserves". See the method sign_up
for more
details about the signing up and queuing process.
|
|||
|
|||
string |
|
||
|
|||
int |
|
||
boolean |
|
||
int |
|
||
|
|||
|
|||
string |
|
||
list of student objects |
|
||
excursion object |
|
||
Inherited from |
|
|||
Inherited from |
|
Creates a new excursion with the given name, sequence number and number of places. No students are registered yet for the new excursion.
|
Returns a string description of the excursion's main data. This
description is of the form "
|
Adds more places to the excursion.
|
Returns the number of students that can take part in the excursion.
|
Returns a boolean value indicating if, as matters currently stand, the
student will be able to take part in the excursion. That is, a return
value of
|
Determines if the given student is a "reserve", that is, if the student has signed up but currently does not have a place available. If so, determines the position of the student in the queue of reserves. A positive return value indicates the students position: 1 means the first of the reserves (the one who will be the first to get a place if someone cancels), 2 means the next reserve, and so on.
|
Signs up the given student for the excursion. If the given student was already signed up for the excursion, nothing needs to be done. Otherwise, the excursion determines the position in which the student is placed amongst other students who have signed up. This is done according to two rules:
|
Cancels the given students registration for the excursion.
|
Returns a listing of the students who currently have places on the
excursion, in order. The listing is prefaced by a generic description of
the excursion obtained by calling MiniExqu #1 (5/3) - Bob (1) - Adam (1) - Cecilia (3) Note that students in reserve are not included in this listing.
|
Returns the students who are in reserve for this excursion. That is, returns a list containing the students who are queuing up in hopes of cancellations or additional available places.
|
Creates and returns a new excursion which is a "re-run" of this excursion. The new excursion has the same name as this one, a sequence number which is higher by one than this one's, and the given number of places available. Furthermore, all this excursion's reserve students are moved (in the same order) to the newly created re-run excursion. ("Moving" means that they are removed from the old excursion and added to the new one.)
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Aug 30 15:34:21 2012 | http://epydoc.sourceforge.net |