|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectifs.model.Constraint
ttsolver.constraint.RoomConstraint
public class RoomConstraint
Room constraint.
Classes with the same room can not overlap in time.
| Constructor Summary | |
|---|---|
RoomConstraint(String id,
String name,
int slotsPerDay,
int days,
String description)
Constructor |
|
| Method Summary | |
|---|---|
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. |
int |
countUselessSlots()
Number of useless slots for this room |
int |
getDays()
Number of days |
String |
getDescription()
Room description |
String |
getName()
Room name |
Lecture[] |
getResource()
Lookup table getResource()[slot] -> lecture using this room placed in the given time slot (null if empty) |
String |
getResourceId()
Room id |
int |
getSlotsPerDay()
Number of slots per day |
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. |
protected void |
printUsage(StringBuffer sb)
Room usage |
String |
toString()
|
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, getId, getInfo, getModel, hashCode, isHard, removeConstraintListener, removeVariable, setModel, variables |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RoomConstraint(String id,
String name,
int slotsPerDay,
int days,
String description)
id - room idname - room nameslotsPerDay - number of slots per daydays - number of daysdescription - room description| Method Detail |
|---|
public String getResourceId()
public String getName()
getName in class Constraintpublic int getSlotsPerDay()
public int getDays()
public void computeConflicts(Value value,
Set conflicts)
Constraint
computeConflicts in class Constraintvalue - value to be assigned to its varaibleconflicts - resultant set of conflicting valuespublic boolean inConflict(Value value)
ConstraintMacPropagation).
inConflict in class Constraint
public boolean isConsistent(Value value1,
Value value2)
ConstraintMacPropagation).
isConsistent in class Constraint
public void assigned(long iteration,
Value value)
Constraint
assigned in class Constraint
public void unassigned(long iteration,
Value value)
Constraint
unassigned in class Constraintpublic Lecture[] getResource()
public int countUselessSlots()
protected void printUsage(StringBuffer sb)
public String toString()
toString in class Objectpublic String getDescription()
getDescription in class Constraint
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||