org.cpsolver.instructor.constraints

## Enum GroupConstraint.ConstraintType

- java.lang.Object
- - java.lang.Enum<GroupConstraint.ConstraintType>
  - - org.cpsolver.instructor.constraints.GroupConstraint.ConstraintType

- All Implemented Interfaces:
    Serializable, Comparable<GroupConstraint.ConstraintType>, GroupConstraint.Check, GroupConstraint.ConstraintTypeInterface
  Enclosing class:
    GroupConstraint

      public static enum GroupConstraint.ConstraintType
      extends Enum<GroupConstraint.ConstraintType>
      implements GroupConstraint.ConstraintTypeInterface

  Distribution types and their implementation

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `BREAK` There must be a break of a given length in a given time interval.
    `MAX_BLOCK` Given classes must be taught in a way there is a break between two blocks of classes.
    `MAX_BREAKS` Limit number of breaks between adjacent classes on a day.
    `MAX_CONSECUTIVE_DAYS` Limit number of consecutive days of a week.
    `MAX_DAYS` Limit number of days of a week.
    `MAX_HALF_DAYS` Limit number of half-days of a week.
    `MAX_HOLES` Minimize free time of an instructor during a day (between the first and the last class).
    `MAX_HRS_DAY` At Most X Hours A Day: Classes are to be placed in a way that there is no more than given number of hours in any day.
    `MAX_WEEKS` Limit number of weeks on which an a class can take place.
    `MIN_GAP` Minimal gap between classes.
    `SAME_DAYS` Same Days: Given classes must be taught on the same days.
    `SAME_ROOM` Same Room: Given classes must be taught in the same room.
    `SAME_START` Same Start Time: Given classes must start during the same half-hour period of a day (independent of the actual day the classes meet).
    `SAME_WEEKS` Given classes must be taught during the same weeks (i.e., must have the same date pattern).
    `WORKDAY` Work Day: Classes are to be placed in a way that there is no more than given number of hours between the start of the first class and the end of the class one on any day.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `computeConflicts(GroupConstraint.Distribution distribution, Assignment<TeachingRequest.Variable,TeachingAssignment> assignment, TeachingAssignment value, Set<TeachingAssignment> conflicts)`
    `String` | `getName()`
    `double` | `getValue(GroupConstraint.Distribution distribution, Assignment<TeachingRequest.Variable,TeachingAssignment> assignment, Instructor instructor, TeachingAssignment value)`
    `String` | `reference()`
    `GroupConstraint.ConstraintType` | `type()`
    `static GroupConstraint.ConstraintType` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static GroupConstraint.ConstraintType[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

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

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### SAME_DAYS

          public static final GroupConstraint.ConstraintType SAME_DAYS

      Same Days: Given classes must be taught on the same days. In case of classes of different time patterns, a class with fewer meetings must meet on a subset of the days used by the class with more meetings. For example, if one class pattern is 3x50, all others given in the constraint can only be taught on Monday, Wednesday, or Friday. For a 2x100 class MW, MF, WF is allowed but TTh is prohibited.
      When prohibited or (strongly) discouraged: any pair of classes classes cannot be taught on the same days (cannot overlap in days). For instance, if one class is MFW, the second has to be TTh.

    - #### SAME_START

          public static final GroupConstraint.ConstraintType SAME_START

      Same Start Time: Given classes must start during the same half-hour period of a day (independent of the actual day the classes meet). For instance, MW 7:30 is compatible with TTh 7:30 but not with MWF 8:00.
      When prohibited or (strongly) discouraged: any pair of classes in the given constraint cannot start during the same half-hour period of any day of the week.

    - #### SAME_ROOM

          public static final GroupConstraint.ConstraintType SAME_ROOM

      Same Room: Given classes must be taught in the same room.
      When prohibited or (strongly) discouraged: any pair of classes in the constraint cannot be taught in the same room.

    - #### MAX_HRS_DAY

          public static final GroupConstraint.ConstraintType MAX_HRS_DAY

      At Most X Hours A Day: Classes are to be placed in a way that there is no more than given number of hours in any day.

    - #### SAME_WEEKS

          public static final GroupConstraint.ConstraintType SAME_WEEKS

      Given classes must be taught during the same weeks (i.e., must have the same date pattern).
      When prohibited or (strongly) discouraged: any two classes must have non overlapping date patterns.

    - #### WORKDAY

          public static final GroupConstraint.ConstraintType WORKDAY

      Work Day: Classes are to be placed in a way that there is no more than given number of hours between the start of the first class and the end of the class one on any day.

    - #### MIN_GAP

          public static final GroupConstraint.ConstraintType MIN_GAP

      Minimal gap between classes.

    - #### MAX_BLOCK

          public static final GroupConstraint.ConstraintType MAX_BLOCK

      Given classes must be taught in a way there is a break between two blocks of classes.

    - #### MAX_BREAKS

          public static final GroupConstraint.ConstraintType MAX_BREAKS

      Limit number of breaks between adjacent classes on a day.

    - #### MAX_DAYS

          public static final GroupConstraint.ConstraintType MAX_DAYS

      Limit number of days of a week.

    - #### BREAK

          public static final GroupConstraint.ConstraintType BREAK

      There must be a break of a given length in a given time interval.

    - #### MAX_WEEKS

          public static final GroupConstraint.ConstraintType MAX_WEEKS

      Limit number of weeks on which an a class can take place.

    - #### MAX_HOLES

          public static final GroupConstraint.ConstraintType MAX_HOLES

      Minimize free time of an instructor during a day (between the first and the last class).

    - #### MAX_HALF_DAYS

          public static final GroupConstraint.ConstraintType MAX_HALF_DAYS

      Limit number of half-days of a week.

    - #### MAX_CONSECUTIVE_DAYS

          public static final GroupConstraint.ConstraintType MAX_CONSECUTIVE_DAYS

      Limit number of consecutive days of a week.

  - ### Method Detail

    - #### values

          public static GroupConstraint.ConstraintType[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (GroupConstraint.ConstraintType c : GroupConstraint.ConstraintType.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static GroupConstraint.ConstraintType valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

    - #### type

          public GroupConstraint.ConstraintType type()

      Specified by:
        `type` in interface `GroupConstraint.ConstraintTypeInterface`

    - #### reference

          public String reference()

      Specified by:
        `reference` in interface `GroupConstraint.ConstraintTypeInterface`

    - #### getName

          public String getName()

      Specified by:
        `getName` in interface `GroupConstraint.ConstraintTypeInterface`

    - #### getValue

          public double getValue(GroupConstraint.Distribution distribution,
                                 Assignment<TeachingRequest.Variable,TeachingAssignment> assignment,
                                 Instructor instructor,
                                 TeachingAssignment value)

      Specified by:
        `getValue` in interface `GroupConstraint.Check`

    - #### computeConflicts

          public void computeConflicts(GroupConstraint.Distribution distribution,
                                       Assignment<TeachingRequest.Variable,TeachingAssignment> assignment,
                                       TeachingAssignment value,
                                       Set<TeachingAssignment> conflicts)

      Specified by:
        `computeConflicts` in interface `GroupConstraint.Check`