org.cpsolver.studentsct.constraint

## Class StudentNotAvailable

- java.lang.Object
- - org.cpsolver.ifs.model.Constraint<V,T>
  - - org.cpsolver.ifs.model.GlobalConstraint<Request,Enrollment>
    - - org.cpsolver.studentsct.constraint.StudentNotAvailable

- All Implemented Interfaces:
    Comparable<Constraint<Request,Enrollment>>

      public class StudentNotAvailable
      extends GlobalConstraint<Request,Enrollment>

  Student not available. This global constraint ensures that all students are available during their enrollments. That is the student does not have any overlapping unavailabilities that do not allow for overlap. Function `Student.isAvailable(Enrollment)` is used.
  Version:
    StudentSct 1.3 (Student Sectioning)
    Copyright (C) 2014 Tomáš Müller
    muller@unitime.org
    http://muller.unitime.org
    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    You should have received a copy of the GNU Lesser General Public License along with this library; if not see http://www.gnu.org/licenses/.
  Author:
    Tomáš Müller

- - ### Field Summary

    - ### Fields inherited from class org.cpsolver.ifs.model.Constraint

      `iConstraintListeners, iId`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StudentNotAvailable()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `computeConflicts(Assignment<Request,Enrollment> assignment, Enrollment enrollment, Set<Enrollment> conflicts)` A given enrollment is conflicting, if the student is not available.
    `boolean` | `inConflict(Assignment<Request,Enrollment> assignment, Enrollment enrollment)` A given enrollment is conflicting, if the student is not available.
    `String` | `toString()`

    - ### Methods inherited from class org.cpsolver.ifs.model.GlobalConstraint

      `addVariable, assigned, assignedVariables, countAssignedVariables, getName, removeVariable, unassigned, variables`

    - ### Methods inherited from class org.cpsolver.ifs.model.Constraint

      `addConstraintListener, compareTo, computeConflictsNoForwardCheck, constraintListeners, countVariables, equals, getDescription, getId, getModel, hashCode, isConsistent, isHard, removeConstraintListener, setModel`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### StudentNotAvailable

          public StudentNotAvailable()

  - ### Method Detail

    - #### computeConflicts

          public void computeConflicts(Assignment<Request,Enrollment> assignment,
                                       Enrollment enrollment,
                                       Set<Enrollment> conflicts)

      A given enrollment is conflicting, if the student is not available. That is there is at least one unavailability that cannot overlap and that is overlapping with the enrollment.
      Specified by:
        `computeConflicts` in class `Constraint<Request,Enrollment>`
      Parameters:
        `enrollment` - `Enrollment` that is being considered
        `conflicts` - all computed conflicting enrollments are added into this set
        `assignment` - current assignment

    - #### inConflict

          public boolean inConflict(Assignment<Request,Enrollment> assignment,
                                    Enrollment enrollment)

      A given enrollment is conflicting, if the student is not available. That is there is at least one unavailability that cannot overlap and that is overlapping with the enrollment.
      Overrides:
        `inConflict` in class `Constraint<Request,Enrollment>`
      Parameters:
        `enrollment` - `Enrollment` that is being considered
        `assignment` - current assignment
      Returns:
        true, if the student is not available during the given enrollment

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `GlobalConstraint<Request,Enrollment>`