org.cpsolver.studentsct.model

## Class Section.SectionContext

- java.lang.Object
- - org.cpsolver.studentsct.model.Section.SectionContext

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

      public class Section.SectionContext
      extends Object
      implements AssignmentConstraintContext<Request,Enrollment>

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SectionContext(Assignment<Request,Enrollment> assignment)`
    `SectionContext(Section.SectionContext 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 section 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 section, excluding the given one.
    `double` | `getMaxEnrollmentWeight()` Maximal weight of a single enrollment in the section
    `double` | `getMinEnrollmentWeight()` Minimal weight of a single enrollment in the section
    `void` | `unassigned(Assignment<Request,Enrollment> assignment, Enrollment enrollment)` Called when an enrollment with this section 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

    - #### SectionContext

          public SectionContext(Assignment<Request,Enrollment> assignment)

    - #### SectionContext

          public SectionContext(Section.SectionContext parent)

  - ### Method Detail

    - #### assigned

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

      Called when an enrollment with this section 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 section 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

    - #### getEnrollments

          public Set<Enrollment> getEnrollments()

      Set of assigned enrollments
      Returns:
        assigned enrollments of this section

    - #### getEnrollmentWeight

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

      Enrollment weight -- weight of all requests which have an enrollment that contains this section, excluding the given one. See `Request.getWeight()`.
      Parameters:
        `assignment` - current assignment
        `excludeRequest` - course request to ignore, if any
      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` - course request to ignore, if any
      Returns:
        enrollment weight

    - #### getMaxEnrollmentWeight

          public double getMaxEnrollmentWeight()

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

    - #### getMinEnrollmentWeight

          public double getMinEnrollmentWeight()

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