|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.cpsolver.ifs.model.Constraint net.sf.cpsolver.ifs.example.tt.Resource
public class Resource
Resource constraint
Field Summary | |
---|---|
static int |
TYPE_CLASS
|
static int |
TYPE_INSTRUCTOR
|
static int |
TYPE_OTHER
|
static int |
TYPE_ROOM
|
Fields inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
iAssignedVariables, iConstraintListeners, iId |
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 net.sf.cpsolver.ifs.model.Constraint |
---|
addConstraintListener, addVariable, assignedVariables, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, hashCode, isHard, removeConstraintListener, removeVariable, variables |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TYPE_ROOM
public static final int TYPE_INSTRUCTOR
public static final int TYPE_CLASS
public static final int TYPE_OTHER
Constructor Detail |
---|
public Resource(String id, int type, String name)
Method Detail |
---|
public void setModel(Model model)
Constraint
setModel
in class Constraint
public String getResourceId()
public String getName()
Constraint
getName
in class Constraint
public int getType()
public Set getProhibitedSlots()
public Set 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(Value value, Set conflicts)
Constraint
computeConflicts
in class Constraint
value
- value to be assigned to its varaibleconflicts
- resultant set of conflicting valuespublic boolean inConflict(Value value)
Constraint
MacPropagation
).
inConflict
in class Constraint
public boolean isConsistent(Value value1, Value value2)
Constraint
MacPropagation
).
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 Constraint
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |