scheduler.generate
Class Generate

java.lang.Object
  extended by java.util.Observable
      extended by scheduler.generate.Generate

public class Generate
extends java.util.Observable

Contains the methods for generating a schedule. Most of the "magic" behind this class is hidden under the mask of the Generate_ui class. Thus, much of what is contained here is "under the hood". Furthermore, this class does not contain any of its own: all its information will come from the external, all-powerful database(s).

Author:
Eric Liebowitz, Leland Garofalo, and Aaron Rivera

Field Summary
 Schedule s
          The generated schedule
static java.util.Hashtable<Instructor,Treatment> treatment
          Keeps track of what courses, times, and WTU's an instructor had been assigned
 
Constructor Summary
Generate()
          Just calls super()...does nothing else.
 
Method Summary
private  void addItem(Schedule s, Course c, Instructor i, LocationAndTime lat)
          Tries to add a schedule item to the schedule.
 void generate(java.util.LinkedList<Course> cdb, java.util.LinkedList<Instructor> idb, java.util.LinkedList<Location> ldb)
          Generates a schedule.
 Schedule getSchedule()
          Part of the last-minute hack I did to make sure you could "observe" the schedule.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

treatment

public static java.util.Hashtable<Instructor,Treatment> treatment
Keeps track of what courses, times, and WTU's an instructor had been assigned


s

public Schedule s
The generated schedule

Constructor Detail

Generate

public Generate()
Just calls super()...does nothing else.

Method Detail

generate

public void generate(java.util.LinkedList<Course> cdb,
                     java.util.LinkedList<Instructor> idb,
                     java.util.LinkedList<Location> ldb)
Generates a schedule.

Parameters:
cdb - The list of courses to schedule
idb - The list of instructors with which to teach the courses
ldb - The list of location in which to teach the courses

addItem

private void addItem(Schedule s,
                     Course c,
                     Instructor i,
                     LocationAndTime lat)
Tries to add a schedule item to the schedule. If the add is successful, the course and its WTU's will be added to an instructor's assignment information, and the course's section cound will be decremented.


getSchedule

public Schedule getSchedule()
Part of the last-minute hack I did to make sure you could "observe" the schedule. In later revisions, this will be fixed by modifying the Schedule class to contain its own generate method.