org.cpsolver.coursett.constraint

## Class MaxHalfDaysFlexibleConstraint.MaxHalfDaysFlexibleConstraintContext

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

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

      public class MaxHalfDaysFlexibleConstraint.MaxHalfDaysFlexibleConstraintContext
      extends FlexibleConstraint.FlexibleConstraintContext

- - ### Field Summary

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

      `iLastPreference`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MaxHalfDaysFlexibleConstraintContext(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>[]` | `getHalfDayAssignments(BitSet week)`
    `protected boolean` | `hasDay(BitSet week, int dayOfWeek, Placement value)`
    `int` | `nrHalfDays(BitSet week, Placement value, Set<Placement> conflicts)`
    `int` | `nrHalfDays(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

    - #### MaxHalfDaysFlexibleConstraintContext

          public MaxHalfDaysFlexibleConstraintContext(Assignment<Lecture,Placement> assignment)

  - ### Method Detail

    - #### hasDay

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

    - #### getHalfDayAssignments

          protected Set<Lecture>[] getHalfDayAssignments(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

    - #### nrHalfDays

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

    - #### nrHalfDays

          public int nrHalfDays(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)