Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## ifs.example.tt
Class Resource

    java.lang.Object
      ifs.model.Constraint
          ifs.example.tt.Resource

    public class Resource

extends Constraint

Resource constraint

Version:
  1.0
Author:
  Tomáš Müller

Field Summary
`static int` | `TYPE_CLASS`
`static int` | `TYPE_INSTRUCTOR`
`static int` | `TYPE_OTHER`
`static int` | `TYPE_ROOM`

Constructor Summary
`Resource(String id, int type, String name)`

Method Summary
`void` | `addDiscouragedSlot(int slot)`
`void` | `addDiscouragedSlot(int day, int hour)`
`void` | `addProhibitedSlot(int slot)`
`void` | `addProhibitedSlot(int day, int hour)`
`void` | `assigned(long iteration, Value value)` Given value is to be assigned to its varable.
`void` | `computeConflicts(Value value, Set conflicts)` The only method which has to be implemented by any constraint.
`Set` | `getDiscouragedSlots()`
`String` | `getName()` Constraint's name -- for printing purposes
`Set` | `getProhibitedSlots()`
`String` | `getResourceId()`
`int` | `getType()`
`boolean` | `inConflict(Value value)` Returns true if the given assignment is inconsistent with the existing assignments respecting this constraint.
`boolean` | `isConsistent(Value value1, Value value2)` Returns true if the given assignments are consistent respecting this constraint.
`boolean` | `isDiscouragedSlot(int slot)`
`boolean` | `isDiscouragedSlot(int day, int hour)`
`boolean` | `isProhibited(int day, int hour, int length)`
`boolean` | `isProhibitedSlot(int slot)`
`boolean` | `isProhibitedSlot(int day, int hour)`
`void` | `setModel(Model model)` Sets the model which the constraint belongs to
`void` | `unassigned(long iteration, Value value)` Given value is unassigned from its varable.

Methods inherited from class ifs.model.Constraint
`addConstraintListener, addVariable, assignedVariables, countAssignedVariables, countVariables, getDescription, getId, getInfo, getModel, hashCode, isHard, removeConstraintListener, removeVariable, variables`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TYPE_ROOM

    public static final int TYPE_ROOM

See Also:
  Constant Field Values

### TYPE_INSTRUCTOR

    public static final int TYPE_INSTRUCTOR

See Also:
  Constant Field Values

### TYPE_CLASS

    public static final int TYPE_CLASS

See Also:
  Constant Field Values

### TYPE_OTHER

    public static final int TYPE_OTHER

See Also:
  Constant Field Values

Constructor Detail

### Resource

    public Resource(String id,
                    int type,
                    String name)

Method Detail

### setModel

    public void setModel(Model model)

  Description copied from class: `Constraint`
  Sets the model which the constraint belongs to

  Overrides:
    `setModel` in class `Constraint`

### getResourceId

    public String getResourceId()

### getName

    public String getName()

  Description copied from class: `Constraint`
  Constraint's name -- for printing purposes

  Overrides:
    `getName` in class `Constraint`

### getType

    public int getType()

### getProhibitedSlots

    public Set getProhibitedSlots()

### getDiscouragedSlots

    public Set getDiscouragedSlots()

### addProhibitedSlot

    public void addProhibitedSlot(int day,
                                  int hour)

### addDiscouragedSlot

    public void addDiscouragedSlot(int day,
                                   int hour)

### isProhibitedSlot

    public boolean isProhibitedSlot(int day,
                                    int hour)

### isDiscouragedSlot

    public boolean isDiscouragedSlot(int day,
                                     int hour)

### addProhibitedSlot

    public void addProhibitedSlot(int slot)

### addDiscouragedSlot

    public void addDiscouragedSlot(int slot)

### isProhibitedSlot

    public boolean isProhibitedSlot(int slot)

### isDiscouragedSlot

    public boolean isDiscouragedSlot(int slot)

### isProhibited

    public boolean isProhibited(int day,
                                int hour,
                                int length)

### computeConflicts

    public void computeConflicts(Value value,
                                 Set conflicts)

  Description copied from class: `Constraint`
  The only method which has to be implemented by any constraint. It returns the values which needs to be unassigned in order to make this constraint consistent with the given value if it is assigned to its variable. The computed list of conflicting values is added to the given set of conflicts.

  Specified by:
    `computeConflicts` in class `Constraint`
  Parameters:
    `value` - value to be assigned to its varaible
    `conflicts` - resultant set of conflicting values

### inConflict

    public boolean inConflict(Value value)

  Description copied from class: `Constraint`
  Returns true if the given assignment is inconsistent with the existing assignments respecting this constraint. This method is used by MAC (see `MacPropagation`).

  Overrides:
    `inConflict` in class `Constraint`

### isConsistent

    public boolean isConsistent(Value value1,
                                Value value2)

  Description copied from class: `Constraint`
  Returns true if the given assignments are consistent respecting this constraint. This method is used by MAC (see `MacPropagation`).

  Overrides:
    `isConsistent` in class `Constraint`

### assigned

    public void assigned(long iteration,
                         Value value)

  Description copied from class: `Constraint`
  Given value is to be assigned to its varable. In this method, the constraint should unassigns all varaibles which are in conflict with the given assignment because of this constraint.

  Overrides:
    `assigned` in class `Constraint`

### unassigned

    public void unassigned(long iteration,
                           Value value)

  Description copied from class: `Constraint`
  Given value is unassigned from its varable.

  Overrides:
    `unassigned` in class `Constraint`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005 Tomáš Müller