org.cpsolver.studentsct.reservation

## Class Reservation.ReservationContext

- java.lang.Object
- - org.cpsolver.studentsct.reservation.Reservation.ReservationContext

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

      public class Reservation.ReservationContext
      extends Object
      implements AssignmentConstraintContext<Request,Enrollment>

- - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `assigned(Assignment<Request,Enrollment> assignment, Enrollment enrollment)` Notify reservation about an unassignment
    `Set<Enrollment>` | `getEnrollments()` Enrollments assigned using this reservation
    `double` | `getReservedAvailableSpace(Assignment<Request,Enrollment> assignment, Config config, Request excludeRequest)` Available reserved space for a particular config
    `double` | `getReservedAvailableSpace(Assignment<Request,Enrollment> assignment, Request excludeRequest)` Available reserved space
    `double` | `getUsedSpace()` Used space
    `double` | `getUsedSpace(Config config)` Used space in a particular config
    `void` | `unassigned(Assignment<Request,Enrollment> assignment, Enrollment enrollment)` Notify reservation about an assignment

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

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

- - ### Constructor Detail

    - #### ReservationContext

          public ReservationContext(Assignment<Request,Enrollment> assignment)

    - #### ReservationContext

          public ReservationContext(Reservation.ReservationContext parent)

  - ### Method Detail

    - #### assigned

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

      Notify reservation about an unassignment
      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)

      Notify reservation about an assignment
      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()

      Enrollments assigned using this reservation
      Returns:
        assigned enrollments of this reservation

    - #### getUsedSpace

          public double getUsedSpace()

      Used space
      Returns:
        spaced used of this reservation

    - #### getUsedSpace

          public double getUsedSpace(Config config)

      Used space in a particular config
      Returns:
        spaced used of this reservation

    - #### getReservedAvailableSpace

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

      Available reserved space
      Parameters:
        `assignment` - current assignment
        `excludeRequest` - excluding given request (if not null)
      Returns:
        available reserved space

    - #### getReservedAvailableSpace

          public double getReservedAvailableSpace(Assignment<Request,Enrollment> assignment,
                                                  Config config,
                                                  Request excludeRequest)

      Available reserved space for a particular config
      Parameters:
        `assignment` - current assignment
        `excludeRequest` - excluding given request (if not null)
      Returns:
        available reserved space