org.cpsolver.coursett.constraint

## Class MaxConsecutiveDaysFlexibleConstraint.MaxConsecutiveDaysFlexibleConstraintContext

- java.lang.Object
- - org.cpsolver.coursett.constraint.FlexibleConstraint.FlexibleConstraintContext
  - - org.cpsolver.coursett.constraint.MaxConsecutiveDaysFlexibleConstraint.MaxConsecutiveDaysFlexibleConstraintContext

- All Implemented Interfaces:
    AssignmentConstraintContext<Lecture,Placement>, AssignmentContext
  Enclosing class:
    MaxConsecutiveDaysFlexibleConstraint

      public class MaxConsecutiveDaysFlexibleConstraint.MaxConsecutiveDaysFlexibleConstraintContext
      extends FlexibleConstraint.FlexibleConstraintContext

- - ### Field Summary

    - ### Fields inherited from class org.cpsolver.coursett.constraint.FlexibleConstraint.FlexibleConstraintContext

      `iLastPreference`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MaxConsecutiveDaysFlexibleConstraintContext(Assignment<Lecture,Placement> assignment)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `assigned(Assignment<Lecture,Placement> assignment, Placement value)` Called when `ConstraintWithContext.assigned(Assignment, long, Value)` is called to update the content of the context.
    `Set<Lecture>` | `candidates(Placement value, Set<Placement> conflicts)`
    `protected Set<Lecture>[]` | `getDayAssignments(BitSet week)`
    `int` | `nrDays(BitSet week, Placement value, Set<Placement> conflicts)`
    `int` | `nrDays(Placement value, Set<Placement> conflicts)`
    `int` | `nrViolations(BitSet week, HashMap<Lecture,Placement> assignments, Set<Placement> conflicts)`
    `int` | `nrViolations(HashMap<Lecture,Placement> assignments, Set<Placement> conflicts)`
    `protected boolean` | `overlaps(BitSet week, int dayOfWeek, Placement value)`
    `void` | `unassigned(Assignment<Lecture,Placement> assignment, Placement value)` Called when `ConstraintWithContext.unassigned(Assignment, long, Value)` is called to update the content of the context.

    - ### Methods inherited from class org.cpsolver.coursett.constraint.FlexibleConstraint.FlexibleConstraintContext

      `getPreference, updateCriterion`

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

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

- - ### Constructor Detail

    - #### MaxConsecutiveDaysFlexibleConstraintContext

          public MaxConsecutiveDaysFlexibleConstraintContext(Assignment<Lecture,Placement> assignment)

  - ### Method Detail

    - #### overlaps

          protected boolean overlaps(BitSet week,
                                     int dayOfWeek,
                                     Placement value)

    - #### getDayAssignments

          protected Set<Lecture>[] getDayAssignments(BitSet week)

    - #### assigned

          public void assigned(Assignment<Lecture,Placement> assignment,
                               Placement value)

      Description copied from interface: `AssignmentConstraintContext`
      Called when `ConstraintWithContext.assigned(Assignment, long, Value)` is called to update the content of the context.
      Specified by:
        `assigned` in interface `AssignmentConstraintContext<Lecture,Placement>`
      Overrides:
        `assigned` in class `FlexibleConstraint.FlexibleConstraintContext`
      Parameters:
        `assignment` - current assignment (with which this context is associated)
        `value` - assigned value

    - #### unassigned

          public void unassigned(Assignment<Lecture,Placement> assignment,
                                 Placement value)

      Description copied from interface: `AssignmentConstraintContext`
      Called when `ConstraintWithContext.unassigned(Assignment, long, Value)` is called to update the content of the context.
      Specified by:
        `unassigned` in interface `AssignmentConstraintContext<Lecture,Placement>`
      Overrides:
        `unassigned` in class `FlexibleConstraint.FlexibleConstraintContext`
      Parameters:
        `assignment` - current assignment (with which this context is associated)
        `value` - unassigned value

    - #### nrDays

          public int nrDays(BitSet week,
                            Placement value,
                            Set<Placement> conflicts)

    - #### nrDays

          public int nrDays(Placement value,
                            Set<Placement> conflicts)

    - #### candidates

          public Set<Lecture> candidates(Placement value,
                                         Set<Placement> conflicts)

    - #### nrViolations

          public int nrViolations(BitSet week,
                                  HashMap<Lecture,Placement> assignments,
                                  Set<Placement> conflicts)

    - #### nrViolations

          public int nrViolations(HashMap<Lecture,Placement> assignments,
                                  Set<Placement> conflicts)