net.sf.cpsolver.studentsct.model
Class Offering

java.lang.Object
  extended by net.sf.cpsolver.studentsct.model.Offering

public class Offering
extends Object

Representation of an instructional offering. An offering contains id, name, the list of course offerings, and the list of possible configurations. See Config and Course.

Version:
StudentSct 1.2 (Student Sectioning)
Copyright (C) 2007 - 2010 Tomas Muller
muller@unitime.org
http://muller.unitime.org

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not see http://www.gnu.org/licenses/.

Constructor Summary
Offering(long id, String name)
          Constructor
 
Method Summary
 void clearReservationCache()
          Clear reservation information that was cached on this offering or below
 boolean equals(Object o)
           
 Set<Choice> getChoices(String instructionalType)
          Return the list of all possible choices of the given instructional type for this offering.
 List<Config> getConfigs()
          Possible configurations
 Course getCourse(Student student)
          Return course, under which the given student enrolls into this offering.
 List<Course> getCourses()
          List of courses.
 long getId()
          Offering id
 Set<String> getInstructionalTypes()
          Return set of instructional types, union over all configurations.
 double getMaxPenalty()
          Maximal penalty from Config.getMaxPenalty()
 double getMinPenalty()
          Minimal penalty from Config.getMinPenalty()
 String getName()
          Offering name
 List<Reservation> getReservations()
          Reservations associated with this offering
 Section getSection(long sectionId)
          Return section of the given id, if it is part of one of this offering configurations.
 Set<Subpart> getSubparts(String instructionalType)
          Return list of all subparts of the given isntructional type for this offering.
 double getTotalUnreservedSpace()
          Total space in the offering that is not reserved by any reservation
 double getUnreservedSpace(Request excludeRequest)
          Available space in the offering that is not reserved by any reservation
 int hashCode()
           
 boolean hasReservations()
          True if there are reservations for this offering
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Offering

public Offering(long id,
                String name)
Constructor

Parameters:
id - instructional offering unique id
name - instructional offering name (this is usually the name of the controlling course)
Method Detail

getId

public long getId()
Offering id


getName

public String getName()
Offering name


getConfigs

public List<Config> getConfigs()
Possible configurations


getCourses

public List<Course> getCourses()
List of courses. One instructional offering can contain multiple courses (names under which it is offered)


getSection

public Section getSection(long sectionId)
Return section of the given id, if it is part of one of this offering configurations.


getCourse

public Course getCourse(Student student)
Return course, under which the given student enrolls into this offering.


getInstructionalTypes

public Set<String> getInstructionalTypes()
Return set of instructional types, union over all configurations.


getChoices

public Set<Choice> getChoices(String instructionalType)
Return the list of all possible choices of the given instructional type for this offering.


getSubparts

public Set<Subpart> getSubparts(String instructionalType)
Return list of all subparts of the given isntructional type for this offering.


getMinPenalty

public double getMinPenalty()
Minimal penalty from Config.getMinPenalty()


getMaxPenalty

public double getMaxPenalty()
Maximal penalty from Config.getMaxPenalty()


toString

public String toString()
Overrides:
toString in class Object

getReservations

public List<Reservation> getReservations()
Reservations associated with this offering


hasReservations

public boolean hasReservations()
True if there are reservations for this offering


getTotalUnreservedSpace

public double getTotalUnreservedSpace()
Total space in the offering that is not reserved by any reservation


getUnreservedSpace

public double getUnreservedSpace(Request excludeRequest)
Available space in the offering that is not reserved by any reservation

Parameters:
excludeRequest - excluding given request (if not null)

clearReservationCache

public void clearReservationCache()
Clear reservation information that was cached on this offering or below


equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2014 UniTime LLC. All Rights Reserved.