net.sf.cpsolver.coursett.criteria.additional

## Class StudentLuchBreak

- java.lang.Object
- - net.sf.cpsolver.ifs.criteria.AbstractCriterion<Lecture,Placement>
  - - net.sf.cpsolver.coursett.criteria.TimetablingCriterion
    - - net.sf.cpsolver.coursett.criteria.StudentConflict
      - - net.sf.cpsolver.coursett.criteria.additional.StudentLuchBreak

- All Implemented Interfaces:
    Criterion<Lecture,Placement>, InfoProvider<Lecture>, ModelListener<Lecture,Placement>

      public class StudentLuchBreak
      extends StudentConflict

  Naive, yet effective approach for modeling student lunch breaks. This criterion is based on `StudentConflict` and it creates a conflict whenever there are two classes (that share students) overlapping with the lunch time which are one after the other with a break in between smaller than the requested lunch break. Lunch time is defined by StudentLunch.StartSlot and StudentLunch.EndStart properties (default is 11:00 am - 1:30 pm), with lunch break of at least StudentLunch.Length slots (default is 30 minutes). Such a conflict is weighted by Comparator.StudentLunchWeight, which defaults to Comparator.StudentConflictWeight.
  Version:
    CourseTT 1.2 (University Course Timetabling)
    Copyright (C) 2006 - 2011 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/.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class net.sf.cpsolver.ifs.criteria.AbstractCriterion

      `AbstractCriterion.ValueUpdateType`

  - ### Field Summary

    - ### Fields inherited from class net.sf.cpsolver.coursett.criteria.StudentConflict

      `iIncludeConflicts`

    - ### Fields inherited from class net.sf.cpsolver.ifs.criteria.AbstractCriterion

      `iBest, iDebug, iValue, iValueUpdateType, iWeight, sDoubleFormat, sPercentFormat`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StudentLuchBreak()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `getInfo(Map<String,String> info)` Adds some information into the table with information about the solution
    `void` | `getInfo(Map<String,String> info, Collection<Lecture> variables)` Adds some information into the table with information about the solution, only consider variables from the given set
    `String` | `getPlacementSelectionWeightName()`
    `double` | `getWeightDefault(DataProperties config)` Defines default weight (when `AbstractCriterion.getWeightName()` parameter is not present in the criterion).
    `boolean` | `inConflict(Placement p1, Placement p2)`
    `boolean` | `init(Solver<Lecture,Placement> solver)` Notification that the model was initialized by the solver.
    `boolean` | `isApplicable(Lecture l1, Lecture l2)`
    `boolean` | `nolunch(Placement p1, Placement p2)`

    - ### Methods inherited from class net.sf.cpsolver.coursett.criteria.StudentConflict

      `applicable, applicable, bestRestored, committed, committed, distance, getBounds, getBounds, getMetrics, getValue, getValue, getValue, hard, hard, ignore, ignore, incJenrl, jointEnrollment, overlaps`

    - ### Methods inherited from class net.sf.cpsolver.coursett.criteria.TimetablingCriterion

      `getAbbreviation, getPlacementSelectionWeight, getPlacementSelectionWeightDefault, toString`

    - ### Methods inherited from class net.sf.cpsolver.ifs.criteria.AbstractCriterion

      `afterAssigned, afterUnassigned, beforeAssigned, beforeUnassigned, bestSaved, clearCache, computeBounds, constraintAdded, constraintRemoved, getBest, getModel, getName, getPerc, getPercRev, getWeight, getWeightedBest, getWeightedValue, getWeightedValue, getWeightedValue, getWeightName, inc, variableAdded, variableRemoved`

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

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

- - ### Constructor Detail

    - #### StudentLuchBreak

          public StudentLuchBreak()

  - ### Method Detail

    - #### init

          public boolean init(Solver<Lecture,Placement> solver)

      Description copied from interface: `ModelListener`
      Notification that the model was initialized by the solver.
      Specified by:
        `init` in interface `ModelListener<Lecture,Placement>`
      Overrides:
        `init` in class `StudentConflict`
      Parameters:
        `solver` - IFS solver

    - #### isApplicable

          public boolean isApplicable(Lecture l1,
                                      Lecture l2)

      Overrides:
        `isApplicable` in class `StudentConflict`

    - #### getWeightDefault

          public double getWeightDefault(DataProperties config)

      Description copied from class: `AbstractCriterion`
      Defines default weight (when `AbstractCriterion.getWeightName()` parameter is not present in the criterion).
      Overrides:
        `getWeightDefault` in class `AbstractCriterion<Lecture,Placement>`

    - #### getPlacementSelectionWeightName

          public String getPlacementSelectionWeightName()

      Overrides:
        `getPlacementSelectionWeightName` in class `StudentConflict`

    - #### nolunch

          public boolean nolunch(Placement p1,
                                 Placement p2)

    - #### inConflict

          public boolean inConflict(Placement p1,
                                    Placement p2)

      Overrides:
        `inConflict` in class `StudentConflict`

    - #### getInfo

          public void getInfo(Map<String,String> info)

      Description copied from interface: `InfoProvider`
      Adds some information into the table with information about the solution
      Specified by:
        `getInfo` in interface `InfoProvider<Lecture>`
      Overrides:
        `getInfo` in class `AbstractCriterion<Lecture,Placement>`

    - #### getInfo

          public void getInfo(Map<String,String> info,
                              Collection<Lecture> variables)

      Description copied from interface: `InfoProvider`
      Adds some information into the table with information about the solution, only consider variables from the given set
      Specified by:
        `getInfo` in interface `InfoProvider<Lecture>`
      Overrides:
        `getInfo` in class `AbstractCriterion<Lecture,Placement>`