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, setType
addConstraintListener, addVariable, assignedVariables, compareTo, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, hashCode, isHard, removeConstraintListener, removeVariable, setModel, variables
public 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)
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>