|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectifs.model.Constraint
ttsolver.constraint.ResourceConstraint
public class ResourceConstraint
Resource constraint.
Classes using this resource can not overlap in time. All classes associated with this
resource are considered to use this resource.
| Field Summary | |
|---|---|
protected int |
iDays
Number of days |
protected Lecture[] |
iResource
table iResource[slot] = lecture using this resource placed in the given time slot (null if empty) |
protected int |
iSlotsPerDay
Number of slots per day |
| Constructor Summary | |
|---|---|
ResourceConstraint(String id,
String name,
int slotsPerDay,
int days)
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 resource |
int |
getDays()
Number of days |
String |
getName()
Resource name |
Lecture[] |
getResource()
Lookup table getResource()[slot] -> lecture using this resource placed in the given time slot (null if empty) |
String |
getResourceId()
Resource 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)
Resource usage 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, getDescription, 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 |
| Field Detail |
|---|
protected Lecture[] iResource
protected int iSlotsPerDay
protected int iDays
| Constructor Detail |
|---|
public ResourceConstraint(String id,
String name,
int slotsPerDay,
int days)
id - resource idname - resource nameslotsPerDay - number of slots per daydays - number of days| 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 Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||