|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.cpsolver.ifs.model.Constraint<Lecture,Placement>
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,
Double x,
Double y,
boolean ignoreTooFar,
boolean constraint)
|
Method Summary | |
---|---|
void |
assigned(long iteration,
Placement value)
Given value is to be assigned to its varable. |
void |
computeConflicts(Placement value,
Set<Placement> conflicts)
The only method which has to be implemented by any constraint. |
int |
getLimit()
|
String |
getName()
Room name |
int |
getUsage()
|
boolean |
inConflict(Placement value)
Returns true if the given assignment is inconsistent with the existing assignments respecting this constraint. |
boolean |
isConsistent(Placement value1,
Placement value2)
Returns true if the given assignments are consistent respecting this constraint. |
boolean |
isEnabled()
|
boolean |
isOverLimit(Placement value)
|
void |
setEnabled(boolean enabled)
|
String |
toString()
|
void |
unassigned(long iteration,
Placement value)
Given value is unassigned from its variable. |
void |
weaken()
Weaken the constraint. |
void |
weaken(Placement value)
Weaken the constraint enough so that it can assign the given value. |
Methods inherited from class net.sf.cpsolver.coursett.constraint.RoomConstraint |
---|
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, compareTo, 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, Double x, Double y, boolean ignoreTooFar, boolean constraint)
Method Detail |
---|
public int getLimit()
public int getUsage()
public boolean isOverLimit(Placement value)
public void computeConflicts(Placement value, Set<Placement> conflicts)
Constraint
computeConflicts
in class RoomConstraint
value
- value to be assigned to its varaibleconflicts
- resultant set of conflicting valuespublic boolean inConflict(Placement value)
Constraint
MacPropagation
).
inConflict
in class RoomConstraint
public boolean isConsistent(Placement value1, Placement value2)
Constraint
MacPropagation
).
isConsistent
in class RoomConstraint
public void assigned(long iteration, Placement value)
Constraint
assigned
in class RoomConstraint
public void unassigned(long iteration, Placement 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()
public void weaken()
WeakeningConstraint
weaken
in interface WeakeningConstraint<Lecture,Placement>
public void weaken(Placement value)
WeakeningConstraint
weaken
in interface WeakeningConstraint<Lecture,Placement>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |