public class Resource extends Constraint<Activity,Location>
| Modifier and Type | Field and Description |
|---|---|
static int |
TYPE_CLASS |
static int |
TYPE_INSTRUCTOR |
static int |
TYPE_OTHER |
static int |
TYPE_ROOM |
iAssignedVariables, iConstraintListeners, iId| Constructor and Description |
|---|
Resource(String id,
int type,
String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDiscouragedSlot(int slot) |
void |
addDiscouragedSlot(int day,
int hour) |
void |
addProhibitedSlot(int slot) |
void |
addProhibitedSlot(int day,
int hour) |
void |
assigned(long iteration,
Location location)
Given value is to be assigned to its varable.
|
void |
computeConflicts(Location location,
Set<Location> conflicts)
The only method which has to be implemented by any constraint.
|
Set<Integer> |
getDiscouragedSlots() |
String |
getName()
Constraint's name -- for printing purposes
|
Set<Integer> |
getProhibitedSlots() |
String |
getResourceId() |
int |
getType() |
boolean |
inConflict(Location location)
Returns true if the given assignment is inconsistent with the existing
assignments respecting this constraint.
|
boolean |
isConsistent(Location l1,
Location l2)
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<Activity,Location> model)
Sets the model which the constraint belongs to
|
void |
unassigned(long iteration,
Location location)
Given value is unassigned from its variable.
|
addConstraintListener, addVariable, assignedVariables, compareTo, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, hashCode, isHard, removeConstraintListener, removeVariable, variablespublic static final int TYPE_ROOM
public static final int TYPE_INSTRUCTOR
public static final int TYPE_CLASS
public static final int TYPE_OTHER
public void setModel(Model<Activity,Location> model)
ConstraintsetModel in class Constraint<Activity,Location>public String getResourceId()
public String getName()
ConstraintgetName in class Constraint<Activity,Location>public int getType()
public Set<Integer> getProhibitedSlots()
public Set<Integer> getDiscouragedSlots()
public void addProhibitedSlot(int day, int hour)
public void addDiscouragedSlot(int day, int hour)
public boolean isProhibitedSlot(int day, int hour)
public boolean isDiscouragedSlot(int day, int hour)
public void addProhibitedSlot(int slot)
public void addDiscouragedSlot(int slot)
public boolean isProhibitedSlot(int slot)
public boolean isDiscouragedSlot(int slot)
public boolean isProhibited(int day, int hour, int length)
public void computeConflicts(Location location, Set<Location> conflicts)
ConstraintcomputeConflicts in class Constraint<Activity,Location>location - value to be assigned to its varaibleconflicts - resultant set of conflicting valuespublic boolean inConflict(Location location)
ConstraintMacPropagation).inConflict in class Constraint<Activity,Location>public boolean isConsistent(Location l1, Location l2)
ConstraintMacPropagation).isConsistent in class Constraint<Activity,Location>public void assigned(long iteration, Location location)
Constraintassigned in class Constraint<Activity,Location>public void unassigned(long iteration, Location location)
Constraintunassigned in class Constraint<Activity,Location>