org.cpsolver.studentsct.model

## Class Config.ConfigContext

- java.lang.Object
- - org.cpsolver.studentsct.model.Config.ConfigContext

- All Implemented Interfaces:
    AssignmentConstraintContext<Request,Enrollment>, AssignmentContext
  Enclosing class:
    Config

      public class Config.ConfigContext
      extends Object
      implements AssignmentConstraintContext<Request,Enrollment>

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConfigContext(Assignment<Request,Enrollment> assignment)`
    `ConfigContext(Config.ConfigContext parent)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `assigned(Assignment<Request,Enrollment> assignment, Enrollment enrollment)` Called when an enrollment with this config is assigned to a request
    `Set<Enrollment>` | `getEnrollments()` Set of assigned enrollments
    `double` | `getEnrollmentTotalWeight(Assignment<Request,Enrollment> assignment, Request excludeRequest)` Enrollment weight including over the limit enrollments.
    `double` | `getEnrollmentWeight(Assignment<Request,Enrollment> assignment, Request excludeRequest)` Enrollment weight -- weight of all requests which have an enrollment that contains this config, excluding the given one.
    `double` | `getMaxEnrollmentWeight()` Maximal weight of a single enrollment in the config
    `double` | `getMinEnrollmentWeight()` Minimal weight of a single enrollment in the config
    `void` | `unassigned(Assignment<Request,Enrollment> assignment, Enrollment enrollment)` Called when an enrollment with this config is unassigned from a request

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ConfigContext

          public ConfigContext(Assignment<Request,Enrollment> assignment)

    - #### ConfigContext

          public ConfigContext(Config.ConfigContext parent)

  - ### Method Detail

    - #### assigned

          public void assigned(Assignment<Request,Enrollment> assignment,
                               Enrollment enrollment)

      Called when an enrollment with this config is assigned to a request
      Specified by:
        `assigned` in interface `AssignmentConstraintContext<Request,Enrollment>`
      Parameters:
        `assignment` - current assignment (with which this context is associated)
        `enrollment` - assigned value

    - #### unassigned

          public void unassigned(Assignment<Request,Enrollment> assignment,
                                 Enrollment enrollment)

      Called when an enrollment with this config is unassigned from a request
      Specified by:
        `unassigned` in interface `AssignmentConstraintContext<Request,Enrollment>`
      Parameters:
        `assignment` - current assignment (with which this context is associated)
        `enrollment` - unassigned value

    - #### getEnrollmentWeight

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

      Enrollment weight -- weight of all requests which have an enrollment that contains this config, excluding the given one. See `Request.getWeight()`.
      Parameters:
        `assignment` - current assignment
        `excludeRequest` - request to exclude
      Returns:
        enrollment weight

    - #### getEnrollmentTotalWeight

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

      Enrollment weight including over the limit enrollments. That is enrollments that have reservation with `Reservation.canBatchAssignOverLimit()` set to true.
      Parameters:
        `assignment` - current assignment
        `excludeRequest` - request to exclude
      Returns:
        enrollment weight

    - #### getEnrollments

          public Set<Enrollment> getEnrollments()

      Set of assigned enrollments
      Returns:
        assigned enrollments (using this configuration)

    - #### getMaxEnrollmentWeight

          public double getMaxEnrollmentWeight()

      Maximal weight of a single enrollment in the config
      Returns:
        maximal enrollment weight

    - #### getMinEnrollmentWeight

          public double getMinEnrollmentWeight()

      Minimal weight of a single enrollment in the config
      Returns:
        minimal enrollment weight