org.cpsolver.ifs.example.rpp

## Class ResourceConstraint.Context

- java.lang.Object
- - org.cpsolver.ifs.example.rpp.ResourceConstraint.Context

- All Implemented Interfaces:
    AssignmentConstraintContext<Rectangle,Location>, AssignmentContext
  Enclosing class:
    ResourceConstraint

      public class ResourceConstraint.Context
      extends Object
      implements AssignmentConstraintContext<Rectangle,Location>

  Assignment context

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Context(Assignment<Rectangle,Location> assignment)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `assigned(Assignment<Rectangle,Location> assignment, Location placement)` Notification, when a rectangle is placed.
    `Rectangle` | `getRectangle(int x, int y)`
    `void` | `unassigned(Assignment<Rectangle,Location> assignment, Location placement)` Notification, when a rectangle is unplaced.

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

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

- - ### Constructor Detail

    - #### Context

          public Context(Assignment<Rectangle,Location> assignment)

  - ### Method Detail

    - #### assigned

          public void assigned(Assignment<Rectangle,Location> assignment,
                               Location placement)

      Notification, when a rectangle is placed. It memorizes the rectangle's new position in 2D ([0..width][0..height]) array. It is used for faster lookup when computing conflicts.
      Specified by:
        `assigned` in interface `AssignmentConstraintContext<Rectangle,Location>`
      Parameters:
        `assignment` - current assignment (with which this context is associated)
        `placement` - assigned value

    - #### getRectangle

          public Rectangle getRectangle(int x,
                                        int y)

    - #### unassigned

          public void unassigned(Assignment<Rectangle,Location> assignment,
                                 Location placement)

      Notification, when a rectangle is unplaced. It removes the rectangle from the 2D ([0..width][0..height]) array.
      Specified by:
        `unassigned` in interface `AssignmentConstraintContext<Rectangle,Location>`
      Parameters:
        `assignment` - current assignment (with which this context is associated)
        `placement` - unassigned value