CS 210 - Lab 10: Finishing the Student Registration Process
Due December 6, 2000
Please note due date!
Overview:
Your program will have three major input files;
the class schedule, the students' registration cards, and a file
listing time slots and conflicts. The output of the program would, in
practice, have three major parts; class lists (which are distributed
to instructors), student schedules (which are distributed to
students), and printed statistics which summarize the results of the
scheduling process. For the purposes of this exercise, we will skip
the generation of class lists and student schedules, focussing instead
on the registering of students in courses and the generation of
enrollment statistics, as explained below. Obviously a great deal
of this information is repeated from earlier labs.
In solving this problem, it is important to think about the basic
algorithm for determining how courses are selected for a student. That
is, each course listed in the student_choices Vector must be
searched in a data structure that contains the information about all
courses (as we've done in seemingly countless labs already!). Once
that course is found (assuming it exists), two additional criteria
must be met before that student can be enrolled in that class:
-
That course must not be full to capacity (that is, the field
enrollment, which keeps track of the number of students
already enrolled in that course, must be updated each time a new
student is added to the course), and
-
That course's meeting time must not be in conflict with the meeting
time of any course in which the student is already enrolled.
The first criterion is easy to check. The second criterion can be
checked by keeping a structure of all the possible meeting times, and
along with each one a structure of all times that are in conflict with
that time. Below is a partial list of these meeting times and their
respective conflicting times; their interpretation should be
self-explanatory.
A complete list of all class meeting times alongside all
conflicting times, is given in the file conflicts.data. Below
is a list of the first few lines in that file. Here, the first line
says that the time MWF8 conflicts with the time M-F8, while the third
line says that MWF9 conflicts with each of the three times MW915, MW9,
and MW930.
Finally, the program should produce an output that has the information
shown below.
In addition to the summary enrollment data for each course, the program
should keep track of and display additional "Summary Statistics" and "Run
Time Statistics."
The summary statistics reveal how many students did and did not get
their desired number of courses, the number of times students were rejected
from courses for time conflicts, and the number of times students were
rejected from courses because the course was full.
The run time statistics reveal how much time it took to run the two
major parts of your program, the loading of the class data structure and
the registering of students. These numbers, of course, will vary depending
on your choice of data structure and search strategy for registering students.
Scheduling Algorithm
Essentially you will make successive passes on the students. Starting
with the seniors and working towards the first-years, to register a
student for a course you look at the student's next choice, check if
the course is full, then check if the course conflicts with a course
they are already registered for. If the course is ok, the student
gets it. Remember, a student shouldn't get more courses than they ask
for. On each pass register each student for one course (assuming they
still have courses left to register for).
Major Lab Tasks
The work for this lab can be divided into several major tasks.
- Design classes for students, courses, and conflicts. These should
all be straightforward (and two are basically done already). There
should be variables to store the relevant data for each structure, and
access methods for setting and retrieving data. Ultimately, you will
include each of these in a larger data structure (e.g. a Vector of
students, etc.).
- Design methods to read in all of the files.
-
Design efficient data structures for storage, and flush out the
overall structure of the program.
-
The data structure choices here are Vector, List, Stack, Queue, Binary
SearchTree, and HashTable.
-
Each choice presents performance tradeoffs for adding elements during the
building phase and searching the data structure to find elements during
the registration process.
-
Remember, to register 1400 students with 4 choices per student requires
5600 separate searches in this data structure!
-
Inclusion of appropriate variables and calls to track the run time
statistics for the two major parts of the program.
-
Determining, for a given student and course, whether that course's time
is in conflict with any other courses which the student has been assigned
so far.
-
Registering a single student with the number of courses he/she desires.
-
Keeping track of the appropriate summary statistics
-
Displaying the registration results, summary statistics, and run time
statistics after all the student cards have been processed.
Hand In: a complete, correctly-running, and well-documented
Java program for this problem along with output. Include a discussion
of your choice of data structures. Your grade will depend significantly
on several factors: most notably correctness and readability.
What Not to Do: Discuss the program with any other class
member. Any collaboration beyond the level of fixing a syntax
error will be considered cheating on this project.
However: You will be given class time to work on this in
addition to lab time.