org.cpsolver.coursett.constraint

## Class SpreadConstraint.SpreadConstraintContext

- java.lang.Object
- - org.cpsolver.coursett.constraint.SpreadConstraint.SpreadConstraintContext

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

      public class SpreadConstraint.SpreadConstraintContext
      extends Object
      implements AssignmentConstraintContext<Lecture,Placement>

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SpreadConstraintContext(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 placement)` Called when `ConstraintWithContext.assigned(Assignment, long, Value)` is called to update the content of the context.
    `Set<Placement>` | `getCourses(int time, int day)`
    `int` | `getCurrentPenalty()`
    `int` | `getMaxAllowedPenalty()`
    `int[][]` | `getMaxCourses()`
    `int` | `getMaxCourses(int time, int day)`
    `int` | `getNrCourses(int time, int day, Placement placement)`
    `int` | `getUnassignmentsToWeaken()`
    `void` | `unassigned(Assignment<Lecture,Placement> assignment, Placement placement)` Called when `ConstraintWithContext.unassigned(Assignment, long, Value)` is called to update the content of the context.
    `void` | `weaken()`
    `void` | `weaken(int penalty)`

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

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

- - ### Constructor Detail

    - #### SpreadConstraintContext

          public SpreadConstraintContext(Assignment<Lecture,Placement> assignment)

  - ### Method Detail

    - #### assigned

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

      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)
        `placement` - assigned value

    - #### unassigned

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

      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)
        `placement` - unassigned value

    - #### getMaxCourses

          public int[][] getMaxCourses()

    - #### getMaxCourses

          public int getMaxCourses(int time,
                                   int day)

    - #### getNrCourses

          public int getNrCourses(int time,
                                  int day,
                                  Placement placement)

    - #### getCourses

          public Set<Placement> getCourses(int time,
                                           int day)

    - #### getUnassignmentsToWeaken

          public int getUnassignmentsToWeaken()

    - #### getCurrentPenalty

          public int getCurrentPenalty()

    - #### getMaxAllowedPenalty

          public int getMaxAllowedPenalty()

    - #### weaken

          public void weaken()

    - #### weaken

          public void weaken(int penalty)