org.cpsolver.coursett.constraint

## Class MaxWeeksFlexibleConstraint.MaxWeeksFlexibleConstraintContext

- java.lang.Object
- - org.cpsolver.coursett.constraint.FlexibleConstraint.FlexibleConstraintContext
  - - org.cpsolver.coursett.constraint.MaxWeeksFlexibleConstraint.MaxWeeksFlexibleConstraintContext

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

      public class MaxWeeksFlexibleConstraint.MaxWeeksFlexibleConstraintContext
      extends FlexibleConstraint.FlexibleConstraintContext

- - ### Field Summary

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

      `iLastPreference`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MaxWeeksFlexibleConstraintContext(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)`
    `int` | `nrViolations(HashMap<Lecture,Placement> assignments, Set<Placement> conflicts)`
    `int` | `nrWeeks(Placement value, 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

    - #### MaxWeeksFlexibleConstraintContext

          public MaxWeeksFlexibleConstraintContext(Assignment<Lecture,Placement> assignment)

  - ### Method Detail

    - #### 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

    - #### nrWeeks

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

    - #### candidates

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

    - #### nrViolations

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