public class DiscouragedRoomConstraint extends RoomConstraint implements WeakeningConstraint<Lecture,Placement>
RoomConstraint, however, it tries to minimize the usage of the room
as much as possible.iAssignedVariables, iConstraintListeners, iId| Constructor and Description |
|---|
DiscouragedRoomConstraint(DataProperties config,
Long id,
String name,
Long buildingId,
int capacity,
RoomSharingModel roomSharingModel,
Double x,
Double y,
boolean ignoreTooFar,
boolean constraint) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
getAvailableArray, getBuildingId, getCapacity, getConstraint, getIgnoreTooFar, getPlacement, getPosX, getPosY, getResource, getResourceId, getResourceOfWeek, getRoomName, getSharingModel, getType, isAvailable, isAvailable, printUsage, setCoordinates, setNotAvailable, setTypeaddConstraintListener, addVariable, assignedVariables, compareTo, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, hashCode, isHard, removeConstraintListener, removeVariable, setModel, variablespublic DiscouragedRoomConstraint(DataProperties config, Long id, String name, Long buildingId, int capacity, RoomSharingModel roomSharingModel, Double x, Double y, boolean ignoreTooFar, boolean constraint)
public int getLimit()
public int getUsage()
public boolean isOverLimit(Placement value)
public void computeConflicts(Placement value, Set<Placement> conflicts)
ConstraintcomputeConflicts in class RoomConstraintvalue - value to be assigned to its varaibleconflicts - resultant set of conflicting valuespublic boolean inConflict(Placement value)
ConstraintMacPropagation).inConflict in class RoomConstraintpublic boolean isConsistent(Placement value1, Placement value2)
ConstraintMacPropagation).isConsistent in class RoomConstraintpublic void assigned(long iteration, Placement value)
Constraintassigned in class RoomConstraintpublic void unassigned(long iteration, Placement value)
Constraintunassigned in class RoomConstraintpublic String getName()
RoomConstraintgetName in class RoomConstraintpublic String toString()
toString in class RoomConstraintpublic void setEnabled(boolean enabled)
public boolean isEnabled()
public void weaken()
WeakeningConstraintweaken in interface WeakeningConstraint<Lecture,Placement>public void weaken(Placement value)
WeakeningConstraintweaken in interface WeakeningConstraint<Lecture,Placement>