org.cpsolver.coursett.constraint

## Class MaxDaysFlexibleConstraint.MaxDaysFlexibleConstraintContext

- java.lang.Object
- - org.cpsolver.coursett.constraint.FlexibleConstraint.FlexibleConstraintContext
  - - org.cpsolver.coursett.constraint.MaxDaysFlexibleConstraint.MaxDaysFlexibleConstraintContext

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

      public class MaxDaysFlexibleConstraint.MaxDaysFlexibleConstraintContext
      extends FlexibleConstraint.FlexibleConstraintContext

- - ### Field Summary

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

      `iLastPreference`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MaxDaysFlexibleConstraintContext(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)`
    `protected boolean` | `hasDay(BitSet week, int dayOfWeek, Placement value)`
    `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)`
    `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

    - #### MaxDaysFlexibleConstraintContext

          public MaxDaysFlexibleConstraintContext(Assignment<Lecture,Placement> assignment)

  - ### Method Detail

    - #### hasDay

          protected boolean hasDay(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)