org.cpsolver.studentsct.model

## Class Offering

- java.lang.Object
- - org.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.3 (Student Sectioning)
    Copyright (C) 2007 - 2014 Tomáš Müller
    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/.
  Author:
    Tomáš Müller

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Offering(long id, String name)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clearReservationCache()` Clear reservation information that was cached on this offering or below
    `void` | `clearRestrictionCache()` Clear restriction 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()`
    `Model<Request,Enrollment>` | `getModel()`
    `String` | `getName()` Offering name
    `List<Reservation>` | `getReservations()` Reservations associated with this offering
    `List<Restriction>` | `getRestrictions()` Restrictions 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(Assignment<Request,Enrollment> assignment, 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
    `boolean` | `hasRestrictions()` True if there are restrictions for this offering
    `boolean` | `isDummy()` Dummy courses that should show on the solver dashboard (e.g., because they are loaded due to an other session unavailability)
    `void` | `setDummy(boolean dummy)` Dummy courses that should show on the solver dashboard (e.g., because they are loaded due to an other session unavailability)
    `void` | `setModel(Model<Request,Enrollment> model)`
    `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
      Returns:
        instructional offering unique id

    - #### getName

          public String getName()

      Offering name
      Returns:
        instructional offering name

    - #### getConfigs

          public List<Config> getConfigs()

      Possible configurations
      Returns:
        instructional offering configurations

    - #### getCourses

          public List<Course> getCourses()

      List of courses. One instructional offering can contain multiple courses (names under which it is offered)
      Returns:
        list of course offerings

    - #### getSection

          public Section getSection(long sectionId)

      Return section of the given id, if it is part of one of this offering configurations.
      Parameters:
        `sectionId` - class unique id
      Returns:
        section of the given id

    - #### getCourse

          public Course getCourse(Student student)

      Return course, under which the given student enrolls into this offering.
      Parameters:
        `student` - given student
      Returns:
        course of this offering requested by the student

    - #### getInstructionalTypes

          public Set<String> getInstructionalTypes()

      Return set of instructional types, union over all configurations.
      Returns:
        set of instructional types

    - #### getChoices

          public Set<Choice> getChoices(String instructionalType)

      Return the list of all possible choices of the given instructional type for this offering.
      Parameters:
        `instructionalType` - instructional type
      Returns:
        set of choices of the given instructional type

    - #### getSubparts

          public Set<Subpart> getSubparts(String instructionalType)

      Return list of all subparts of the given isntructional type for this offering.
      Parameters:
        `instructionalType` - instructional type
      Returns:
        subpart of the given instructional type

    - #### getMinPenalty

          public double getMinPenalty()

      Minimal penalty from `Config.getMinPenalty()`
      Returns:
        minimal penalty

    - #### getMaxPenalty

          public double getMaxPenalty()

      Maximal penalty from `Config.getMaxPenalty()`
      Returns:
        maximal penalty

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getReservations

          public List<Reservation> getReservations()

      Reservations associated with this offering
      Returns:
        reservations for this offering

    - #### hasReservations

          public boolean hasReservations()

      True if there are reservations for this offering
      Returns:
        true if there is at least one reservation

    - #### getRestrictions

          public List<Restriction> getRestrictions()

      Restrictions associated with this offering
      Returns:
        restrictions for this offering

    - #### hasRestrictions

          public boolean hasRestrictions()

      True if there are restrictions for this offering
      Returns:
        true if there is at least one restriction

    - #### getTotalUnreservedSpace

          public double getTotalUnreservedSpace()

      Total space in the offering that is not reserved by any reservation
      Returns:
        total unreserved space in the offering

    - #### getUnreservedSpace

          public double getUnreservedSpace(Assignment<Request,Enrollment> assignment,
                                           Request excludeRequest)

      Available space in the offering that is not reserved by any reservation
      Parameters:
        `assignment` - current request
        `excludeRequest` - excluding given request (if not null)
      Returns:
        remaining unreserved space in the offering

    - #### clearReservationCache

          public void clearReservationCache()

      Clear reservation information that was cached on this offering or below

    - #### clearRestrictionCache

          public void clearRestrictionCache()

      Clear restriction 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`

    - #### getModel

          public Model<Request,Enrollment> getModel()

    - #### setModel

          public void setModel(Model<Request,Enrollment> model)

    - #### isDummy

          public boolean isDummy()

      Dummy courses that should show on the solver dashboard (e.g., because they are loaded due to an other session unavailability)
      Returns:
        true if the course is "dummy"

    - #### setDummy

          public void setDummy(boolean dummy)

      Dummy courses that should show on the solver dashboard (e.g., because they are loaded due to an other session unavailability)