net.sf.cpsolver.studentsct.model

## Class Config

- java.lang.Object
- - net.sf.cpsolver.studentsct.model.Config

-     public class Config
      extends Object

  Representation of a configuration of an offering. A configuration contains id, name, an offering and a list of subparts.
  Each instructional offering (see `Offering`) contains one or more configurations. Each configuration contain one or more subparts. Each student has to take a class of each subpart of one of the possible configurations.
  Version:
    StudentSct 1.2 (Student Sectioning)
    Copyright (C) 2007 - 2010 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/.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Config(long id, int limit, String name, Offering offering)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `assigned(Enrollment enrollment)` Called when an enrollment with this config is assigned to a request
    `void` | `clearReservationCache()` Clear reservation information that was cached on this configuration or below
    `boolean` | `equals(Object o)`
    `List<Reservation>` | `getConfigReservations()` Get reservations that require this configuration
    `Set<Enrollment>` | `getEnrollments()` Set of assigned enrollments
    `double` | `getEnrollmentWeight(Request excludeRequest)` Enrollment weight -- weight of all requests which have an enrollment that contains this config, excluding the given one.
    `long` | `getId()` Configuration id
    `int` | `getLimit()` Configuration limit.
    `double` | `getMaxEnrollmentWeight()` Maximal weight of a single enrollment in the config
    `double` | `getMaxPenalty()` Average maximal penalty from `Subpart.getMaxPenalty()`
    `double` | `getMinEnrollmentWeight()` Minimal weight of a single enrollment in the config
    `double` | `getMinPenalty()` Average minimal penalty from `Subpart.getMinPenalty()`
    `String` | `getName()` Configuration name
    `Offering` | `getOffering()` Instructional offering to which this configuration belongs.
    `List<Reservation>` | `getReservations()` Get reservations for this configuration
    `List<Subpart>` | `getSubparts()` List of subparts
    `double` | `getTotalUnreservedSpace()` Total space in the configuration that cannot be reserved by any config reservation
    `double` | `getUnreservedSpace(Request excludeRequest)` Available space in the configuration that is not reserved by any config reservation
    `int` | `hashCode()`
    `void` | `setLimit(int limit)` Set configuration limit
    `String` | `toString()`
    `void` | `unassigned(Enrollment enrollment)` Called when an enrollment with this config is unassigned from a request

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Config

          public Config(long id,
                        int limit,
                        String name,
                        Offering offering)

      Constructor
      Parameters:
        `id` - instructional offering configuration unique id
        `limit` - configuration limit (-1 for unlimited)
        `name` - configuration name
        `offering` - instructional offering to which this configuration belongs

  - ### Method Detail

    - #### getId

          public long getId()

      Configuration id

    - #### getLimit

          public int getLimit()

      Configuration limit. This is defines the maximal number of students that can be enrolled into this configuration at the same time. It is -1 in the case of an unlimited configuration

    - #### setLimit

          public void setLimit(int limit)

      Set configuration limit

    - #### getName

          public String getName()

      Configuration name

    - #### getOffering

          public Offering getOffering()

      Instructional offering to which this configuration belongs.

    - #### getSubparts

          public List<Subpart> getSubparts()

      List of subparts

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getMinPenalty

          public double getMinPenalty()

      Average minimal penalty from `Subpart.getMinPenalty()`

    - #### getMaxPenalty

          public double getMaxPenalty()

      Average maximal penalty from `Subpart.getMaxPenalty()`

    - #### assigned

          public void assigned(Enrollment enrollment)

      Called when an enrollment with this config is assigned to a request

    - #### unassigned

          public void unassigned(Enrollment enrollment)

      Called when an enrollment with this config is unassigned from a request

    - #### getEnrollmentWeight

          public double getEnrollmentWeight(Request excludeRequest)

      Enrollment weight -- weight of all requests which have an enrollment that contains this config, excluding the given one. See `Request.getWeight()`.

    - #### getEnrollments

          public Set<Enrollment> getEnrollments()

      Set of assigned enrollments

    - #### getMaxEnrollmentWeight

          public double getMaxEnrollmentWeight()

      Maximal weight of a single enrollment in the config

    - #### getMinEnrollmentWeight

          public double getMinEnrollmentWeight()

      Minimal weight of a single enrollment in the config

    - #### getUnreservedSpace

          public double getUnreservedSpace(Request excludeRequest)

      Available space in the configuration that is not reserved by any config reservation
      Parameters:
        `excludeRequest` - excluding given request (if not null)

    - #### getTotalUnreservedSpace

          public double getTotalUnreservedSpace()

      Total space in the configuration that cannot be reserved by any config reservation

    - #### getReservations

          public List<Reservation> getReservations()

      Get reservations for this configuration

    - #### getConfigReservations

          public List<Reservation> getConfigReservations()

      Get reservations that require this configuration

    - #### clearReservationCache

          public void clearReservationCache()

      Clear reservation information that was cached on this configuration or below

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`