org.cpsolver.coursett.constraint

## Class FlexibleConstraint.FlexibleConstraintContext

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

- All Implemented Interfaces:
    AssignmentConstraintContext<Lecture,Placement>, AssignmentContext
  Direct Known Subclasses:
    MaxBreaksFlexibleConstraint.MaxBreaksFlexibleConstraintContext, MaxConsecutiveDaysFlexibleConstraint.MaxConsecutiveDaysFlexibleConstraintContext, MaxDaysFlexibleConstraint.MaxDaysFlexibleConstraintContext, MaxHalfDaysFlexibleConstraint.MaxHalfDaysFlexibleConstraintContext, MaxHolesFlexibleConstraint.MaxHolesFlexibleConstraintContext, MaxWeeksFlexibleConstraint.MaxWeeksFlexibleConstraintContext
  Enclosing class:
    FlexibleConstraint

      public class FlexibleConstraint.FlexibleConstraintContext
      extends Object
      implements AssignmentConstraintContext<Lecture,Placement>

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected double` | `iLastPreference`

  - ### 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.
    `double` | `getPreference()`
    `void` | `unassigned(Assignment<Lecture,Placement> assignment, Placement value)` Called when `ConstraintWithContext.unassigned(Assignment, long, Value)` is called to update the content of the context.
    `protected void` | `updateCriterion(Assignment<Lecture,Placement> assignment)` Update value of FlexibleConstraintCriterion and number of violated FlexibleConstraints

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

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

- - ### Field Detail

    - #### iLastPreference

          protected double iLastPreference

  - ### 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>`
      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>`
      Parameters:
        `assignment` - current assignment (with which this context is associated)
        `value` - unassigned value

    - #### updateCriterion

          protected void updateCriterion(Assignment<Lecture,Placement> assignment)

      Update value of FlexibleConstraintCriterion and number of violated FlexibleConstraints

    - #### getPreference

          public double getPreference()