org.cpsolver.coursett.constraint

## Class GroupConstraint.ParametrizedConstraintType<P>

- java.lang.Object
- - org.cpsolver.coursett.constraint.GroupConstraint.ParametrizedConstraintType<P>

- All Implemented Interfaces:
    GroupConstraint.AssignmentPairCheck, GroupConstraint.ConstraintTypeInterface
  Enclosing class:
    GroupConstraint

      public static class GroupConstraint.ParametrizedConstraintType<P>
      extends Object
      implements GroupConstraint.ConstraintTypeInterface

  Constraint type with a parameter

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ParametrizedConstraintType(GroupConstraint.ConstraintType type, P parameter, String reference)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getMax()` Maximum (gap, hours a day) parameter
    `int` | `getMin()` Minimum (gap) parameter
    `String` | `getName()` Constraint name
    `P` | `getParameter()` Return constraint's parameter
    `boolean` | `is(GroupConstraint.Flag f)` Flag check (true if contains given flag)
    `boolean` | `isSatisfied(Assignment<Lecture,Placement> assignment, GroupConstraint gc, Placement plc1, Placement plc2)` Check whether the constraint is satisfied for the given two assignments (required / preferred case)
    `boolean` | `isViolated(Assignment<Lecture,Placement> assignment, GroupConstraint gc, Placement plc1, Placement plc2)` Check whether the constraint is satisfied for the given two assignments (prohibited / discouraged case)
    `String` | `reference()` Constraint reference
    `GroupConstraint.ParametrizedConstraintType<P>` | `setMax(int max)`
    `GroupConstraint.ParametrizedConstraintType<P>` | `setMin(int min)`
    `GroupConstraint.ParametrizedConstraintType<P>` | `setName(String name)`
    `GroupConstraint.ConstraintType` | `type()` Constraint type

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

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

- - ### Constructor Detail

    - #### ParametrizedConstraintType

          public ParametrizedConstraintType(GroupConstraint.ConstraintType type,
                                            P parameter,
                                            String reference)

      Constructor
      Parameters:
        `type` - constraint type
        `parameter` - parameter parsed from the reference using `GroupConstraint.AssignmentParameterPairCheck.create(String, String)`
        `reference` - constraint reference with parameters

  - ### Method Detail

    - #### isSatisfied

          public boolean isSatisfied(Assignment<Lecture,Placement> assignment,
                                     GroupConstraint gc,
                                     Placement plc1,
                                     Placement plc2)

      Description copied from interface: `GroupConstraint.AssignmentPairCheck`
      Check whether the constraint is satisfied for the given two assignments (required / preferred case)
      Specified by:
        `isSatisfied` in interface `GroupConstraint.AssignmentPairCheck`
      Parameters:
        `assignment` - current assignment
        `gc` - Calling group constraint
        `plc1` - First placement
        `plc2` - Second placement
      Returns:
        true if constraint is satisfied

    - #### isViolated

          public boolean isViolated(Assignment<Lecture,Placement> assignment,
                                    GroupConstraint gc,
                                    Placement plc1,
                                    Placement plc2)

      Description copied from interface: `GroupConstraint.AssignmentPairCheck`
      Check whether the constraint is satisfied for the given two assignments (prohibited / discouraged case)
      Specified by:
        `isViolated` in interface `GroupConstraint.AssignmentPairCheck`
      Parameters:
        `assignment` - current assignment
        `gc` - Calling group constraint
        `plc1` - First placement
        `plc2` - Second placement
      Returns:
        true if constraint is satisfied

    - #### getParameter

          public P getParameter()

      Return constraint's parameter
      Returns:
        constraint's parameter

    - #### type

          public GroupConstraint.ConstraintType type()

      Description copied from interface: `GroupConstraint.ConstraintTypeInterface`
      Constraint type
      Specified by:
        `type` in interface `GroupConstraint.ConstraintTypeInterface`
      Returns:
        constraint type

    - #### reference

          public String reference()

      Description copied from interface: `GroupConstraint.ConstraintTypeInterface`
      Constraint reference
      Specified by:
        `reference` in interface `GroupConstraint.ConstraintTypeInterface`
      Returns:
        constraint reference

    - #### getName

          public String getName()

      Description copied from interface: `GroupConstraint.ConstraintTypeInterface`
      Constraint name
      Specified by:
        `getName` in interface `GroupConstraint.ConstraintTypeInterface`
      Returns:
        constraint name

    - #### getMin

          public int getMin()

      Description copied from interface: `GroupConstraint.ConstraintTypeInterface`
      Minimum (gap) parameter
      Specified by:
        `getMin` in interface `GroupConstraint.ConstraintTypeInterface`
      Returns:
        minimum gap (first constraint parameter)

    - #### getMax

          public int getMax()

      Description copied from interface: `GroupConstraint.ConstraintTypeInterface`
      Maximum (gap, hours a day) parameter
      Specified by:
        `getMax` in interface `GroupConstraint.ConstraintTypeInterface`
      Returns:
        maximum gap (second constraint parameter)

    - #### is

          public boolean is(GroupConstraint.Flag f)

      Description copied from interface: `GroupConstraint.ConstraintTypeInterface`
      Flag check (true if contains given flag)
      Specified by:
        `is` in interface `GroupConstraint.ConstraintTypeInterface`
      Parameters:
        `f` - a flag to check
      Returns:
        true if present

    - #### setMin

          public GroupConstraint.ParametrizedConstraintType<P> setMin(int min)

    - #### setMax

          public GroupConstraint.ParametrizedConstraintType<P> setMax(int max)

    - #### setName

          public GroupConstraint.ParametrizedConstraintType<P> setName(String name)