org.cpsolver.coursett.constraint

## Class InstructorConstraint.InstructorConstraintContext

- java.lang.Object
- - org.cpsolver.coursett.constraint.InstructorConstraint.InstructorConstraintContext

- All Implemented Interfaces:
    AssignmentConstraintContext<Lecture,Placement>, AssignmentContext
  Direct Known Subclasses:
    SoftInstructorConstraint.SoftInstructorConstraintContext
  Enclosing class:
    InstructorConstraint

      public class InstructorConstraint.InstructorConstraintContext
      extends Object
      implements AssignmentConstraintContext<Lecture,Placement>

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `iPreference`
    `protected List<Placement>[]` | `iResource`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InstructorConstraintContext(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.
    `int` | `countPreference(Assignment<Lecture,Placement> assignment)`
    `int` | `getNrSlots()`
    `Placement` | `getPlacement(int slot, int day)`
    `List<Placement>` | `getPlacements(int slot)`
    `List<Placement>` | `getPlacements(int slot, BitSet weekCode)`
    `List<Placement>` | `getPlacements(int slot, Placement placement)`
    `int` | `getPreference()` Overall back-to-back preference of this instructor
    `Placement[]` | `getResourceOfWeek(int startDay)`
    `void` | `unassigned(Assignment<Lecture,Placement> assignment, Placement placement)` Called when `ConstraintWithContext.unassigned(Assignment, long, Value)` is called to update the content of the context.

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

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

- - ### Field Detail

    - #### iPreference

          public int iPreference

    - #### iResource

          protected List<Placement>[] iResource

  - ### Constructor Detail

    - #### InstructorConstraintContext

          public InstructorConstraintContext(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

    - #### getPlacements

          public List<Placement> getPlacements(int slot)

    - #### getPlacement

          public Placement getPlacement(int slot,
                                        int day)

    - #### getPlacements

          public List<Placement> getPlacements(int slot,
                                               BitSet weekCode)

    - #### getPlacements

          public List<Placement> getPlacements(int slot,
                                               Placement placement)

    - #### getNrSlots

          public int getNrSlots()

    - #### getResourceOfWeek

          public Placement[] getResourceOfWeek(int startDay)

    - #### getPreference

          public int getPreference()

      Overall back-to-back preference of this instructor
      Returns:
        current distance preference

    - #### countPreference

          public int countPreference(Assignment<Lecture,Placement> assignment)