scheduler.generate
Class FindLocation

java.lang.Object
  extended by scheduler.generate.FindLocation

public class FindLocation
extends java.lang.Object

This class contains methods for selecting the most ideal location for a particular instructor to teach. This method was not included in Generate.java b/c there were multiple persons working on various aspects of the class. So, to enable each person to do his/her work w/o fear of conflicts, each important schedule of scheduling functionality was broken into its own, individual class.

Author:
Aaron Rivera 95%, Eric Liebowitz 5%

Constructor Summary
FindLocation()
           
 
Method Summary
protected static void checkPreconditions(Course course, java.util.LinkedHashMap<Time,Time> timeList, java.util.Collection<Location> locations)
          checks post conditions of the findLocation method
protected static DaysInWeek convert(java.util.Collection<java.lang.Integer> dayList)
          Converts an array of integers to a DaysInWeek object.
static int daysTaught(Course course)
          Determines the number of days a course should be taught
static java.util.LinkedList<LocationAndTime> findLocation(Instructor instructor, Course course, java.util.LinkedHashMap<Time,Time> timeList, java.util.Collection<Location> locations)
          The method takes in a list of preferred times and assigns the highest preferred time possible, give location availability and course requirements
protected static boolean hasCourseReqs(Course course, Location location)
          checks if a given location will be suitable for a given course.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FindLocation

public FindLocation()
Method Detail

findLocation

public static java.util.LinkedList<LocationAndTime> findLocation(Instructor instructor,
                                                                 Course course,
                                                                 java.util.LinkedHashMap<Time,Time> timeList,
                                                                 java.util.Collection<Location> locations)
The method takes in a list of preferred times and assigns the highest preferred time possible, give location availability and course requirements

Parameters:
instructor - instructor to be scheduled
course - course to be scheduled
timeList - linked hash map of start and end times, ordered from most preferable to least
locations - list of locations
Returns:
a list of location and time objects

convert

protected static DaysInWeek convert(java.util.Collection<java.lang.Integer> dayList)
Converts an array of integers to a DaysInWeek object. Each number in an array of Integers is taken to be a "this day is true" flag for a DaysInWeek object. Aaron: I assumed 0 = Mon and 6 = Sun, since Sasi went ahead and broke something as simple as a Calendar convention. Written by: Eric Liebowitz

Parameters:
dayList - Int list to convert

hasCourseReqs

protected static boolean hasCourseReqs(Course course,
                                       Location location)
checks if a given location will be suitable for a given course.

Parameters:
course - course to be checked
location - location to be checked
Returns:

daysTaught

public static int daysTaught(Course course)
Determines the number of days a course should be taught

Parameters:
course -
Returns:
the number of days a course should be taught

checkPreconditions

protected static void checkPreconditions(Course course,
                                         java.util.LinkedHashMap<Time,Time> timeList,
                                         java.util.Collection<Location> locations)
                                  throws java.lang.NullPointerException
checks post conditions of the findLocation method

Parameters:
course -
timeList -
locations -
Throws:
java.lang.NullPointerException