|
||||||||||
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.coursett.constraint.RoomConstraint net.sf.cpsolver.coursett.constraint.DiscouragedRoomConstraint
public class DiscouragedRoomConstraint
Discouraged room constraint.
This constraint is based on RoomConstraint
, however, it tries to minimize the usage of the room as much as possible.
Field Summary |
---|
Fields inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
iAssignedVariables, iConstraintListeners, iId |
Constructor Summary | |
---|---|
DiscouragedRoomConstraint(DataProperties config,
Long id,
String name,
Long buildingId,
int capacity,
RoomSharingModel roomSharingModel,
int x,
int y,
boolean ignoreTooFar,
boolean constraint)
|
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 |
getLimit()
|
String |
getName()
Room name |
int |
getUsage()
|
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 |
isEnabled()
|
boolean |
isOverLimit(Value value)
|
void |
setEnabled(boolean enabled)
|
String |
toString()
|
void |
unassigned(long iteration,
Value value)
Given value is unassigned from its varable. |
Methods inherited from class net.sf.cpsolver.coursett.constraint.RoomConstraint |
---|
clearCache, countUselessSlots, countUselessSlots, countUselessSlotsBrokenTimePatterns, countUselessSlotsHalfHours, getAvailableArray, getBuildingId, getCapacity, getConstraint, getIgnoreTooFar, getPlacement, getPosX, getPosY, getResource, getResourceId, getResourceOfWeek, getRoomName, getSharingModel, getType, isAvailable, isAvailable, printUsage, setCoordinates, setNotAvailable, setType |
Methods inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
addConstraintListener, addVariable, assignedVariables, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, hashCode, isHard, removeConstraintListener, removeVariable, setModel, variables |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DiscouragedRoomConstraint(DataProperties config, Long id, String name, Long buildingId, int capacity, RoomSharingModel roomSharingModel, int x, int y, boolean ignoreTooFar, boolean constraint)
Method Detail |
---|
public int getLimit()
public int getUsage()
public boolean isOverLimit(Value value)
public void computeConflicts(Value value, Set conflicts)
Constraint
computeConflicts
in class RoomConstraint
value
- value to be assigned to its varaibleconflicts
- resultant set of conflicting valuespublic boolean inConflict(Value value)
Constraint
MacPropagation
).
inConflict
in class RoomConstraint
public boolean isConsistent(Value value1, Value value2)
Constraint
MacPropagation
).
isConsistent
in class RoomConstraint
public void assigned(long iteration, Value value)
Constraint
assigned
in class RoomConstraint
public void unassigned(long iteration, Value value)
Constraint
unassigned
in class RoomConstraint
public String getName()
RoomConstraint
getName
in class RoomConstraint
public String toString()
toString
in class RoomConstraint
public void setEnabled(boolean enabled)
public boolean isEnabled()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |