org.cpsolver.studentsct.check

## Class InevitableStudentConflicts.StudentCheck

- java.lang.Object
- - org.cpsolver.studentsct.check.InevitableStudentConflicts.StudentCheck

- Enclosing class:
    InevitableStudentConflicts

      public static class InevitableStudentConflicts.StudentCheck
      extends Object

  Use branch & bound technique to find out whether a student can get a complete schedule.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StudentCheck(List<Request> requests)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `backTrack(Assignment<Request,Enrollment> assignment, int idx)` branch & bound search
    `boolean` | `canAssign(Request request, int idx)` True if the given request can be assigned
    `Enrollment` | `firstConflict(Enrollment enrollment)` First conflicting enrollment
    `Enrollment[]` | `getBestAssignment()` Best schedule
    `int` | `getBestNrAssigned()` Number of requests assigned in the best schedule
    `int` | `getNrAssigned()` Number of assigned requests in the current schedule
    `int` | `getNrAssignedBound(int idx)` Bound for the number of assigned requests in the current schedule
    `void` | `check(Assignment<Request,Enrollment> assignment)` Execute branch & bound, return the best found schedule for the selected student.
    `boolean` | `isBestComplete()` True when the best enrollment is complete
    `void` | `saveBest()` Save the current schedule as the best

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

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

- - ### Constructor Detail

    - #### StudentCheck

          public StudentCheck(List<Request> requests)

      Constructor
      Parameters:
        `requests` - course and free time requests of a student

  - ### Method Detail

    - #### check

          public void check(Assignment<Request,Enrollment> assignment)

      Execute branch & bound, return the best found schedule for the selected student.
      Parameters:
        `assignment` - current assignment

    - #### getBestAssignment

          public Enrollment[] getBestAssignment()

      Best schedule
      Returns:
        best schedule

    - #### getBestNrAssigned

          public int getBestNrAssigned()

      Number of requests assigned in the best schedule
      Returns:
        number of requests assigned in the best schedule

    - #### getNrAssignedBound

          public int getNrAssignedBound(int idx)

      Bound for the number of assigned requests in the current schedule
      Parameters:
        `idx` - index of the request that is being assigned
      Returns:
        bound for the number of assigned requests in the current schedule

    - #### isBestComplete

          public boolean isBestComplete()

      True when the best enrollment is complete
      Returns:
        true when the best enrollment is complete

    - #### saveBest

          public void saveBest()

      Save the current schedule as the best

    - #### firstConflict

          public Enrollment firstConflict(Enrollment enrollment)

      First conflicting enrollment
      Parameters:
        `enrollment` - an enrollment
      Returns:
        first conflicting enrollment with the given one

    - #### canAssign

          public boolean canAssign(Request request,
                                   int idx)

      True if the given request can be assigned
      Parameters:
        `request` - given request
        `idx` - index of the request that is being assigned
      Returns:
        true if the given request can be assigned

    - #### getNrAssigned

          public int getNrAssigned()

      Number of assigned requests in the current schedule
      Returns:
        number of assigned requests in the current schedule

    - #### backTrack

          public void backTrack(Assignment<Request,Enrollment> assignment,
                                int idx)

      branch & bound search
      Parameters:
        `assignment` - current assignment
        `idx` - index of the request that is being assigned