org.cpsolver.studentsct.model

## Class Course.CourseContext

- java.lang.Object
- - org.cpsolver.studentsct.model.Course.CourseContext

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

      public class Course.CourseContext
      extends Object
      implements AssignmentConstraintContext<Request,Enrollment>

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CourseContext(Assignment<Request,Enrollment> assignment)`
    `CourseContext(Course.CourseContext 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 `ConstraintWithContext.assigned(Assignment, long, Value)` is called to update the content of the context.
    `Set<Enrollment>` | `getEnrollments()` Set of assigned enrollments
    `double` | `getEnrollmentWeight(Assignment<Request,Enrollment> assignment, Request excludeRequest)` Enrollment weight -- weight of all requests that are enrolled into this course, excluding the given one.
    `double` | `getMaxEnrollmentWeight()` Maximal weight of a single enrollment in the course
    `double` | `getMinEnrollmentWeight()` Minimal weight of a single enrollment in the course
    `void` | `unassigned(Assignment<Request,Enrollment> assignment, Enrollment enrollment)` Called when `ConstraintWithContext.unassigned(Assignment, long, Value)` is called to update the content of the context.

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

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

- - ### Constructor Detail

    - #### CourseContext

          public CourseContext(Assignment<Request,Enrollment> assignment)

    - #### CourseContext

          public CourseContext(Course.CourseContext parent)

  - ### Method Detail

    - #### assigned

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

      Description copied from interface: `AssignmentConstraintContext`
      Called when `ConstraintWithContext.assigned(Assignment, long, Value)` is called to update the content of the context.
      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)

      Description copied from interface: `AssignmentConstraintContext`
      Called when `ConstraintWithContext.unassigned(Assignment, long, Value)` is called to update the content of the context.
      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 that are enrolled into this course, excluding the given one. See `Request.getWeight()`.
      Parameters:
        `assignment` - current assignment
        `excludeRequest` - request to exclude
      Returns:
        enrollment weight

    - #### getEnrollments

          public Set<Enrollment> getEnrollments()

      Set of assigned enrollments
      Returns:
        assigned enrollments for this course offering

    - #### getMaxEnrollmentWeight

          public double getMaxEnrollmentWeight()

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

    - #### getMinEnrollmentWeight

          public double getMinEnrollmentWeight()

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