public class RoomConstraint extends Constraint<Lecture,Placement>
iAssignedVariables, iConstraintListeners, iId
Constructor and Description |
---|
RoomConstraint(Long id,
String name,
Long buildingId,
int capacity,
RoomSharingModel roomSharingModel,
Double x,
Double y,
boolean ignoreTooFar,
boolean constraint)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
assigned(long iteration,
Placement placement)
Given value is to be assigned to its varable.
|
void |
computeConflicts(Placement placement,
Set<Placement> conflicts)
The only method which has to be implemented by any constraint.
|
List<Placement>[] |
getAvailableArray() |
Long |
getBuildingId()
Building id
|
int |
getCapacity()
Capacity
|
boolean |
getConstraint() |
boolean |
getIgnoreTooFar() |
String |
getName()
Room name
|
Placement |
getPlacement(int slot,
int day) |
Double |
getPosX()
X-position of the building
|
Double |
getPosY()
Y-position of the building
|
List<Placement> |
getResource(int slot)
Lookup table getResource()[slot] -> lecture using this room placed in the
given time slot (null if empty)
|
Long |
getResourceId()
Room id
|
Placement[] |
getResourceOfWeek(int startDay) |
String |
getRoomName() |
RoomSharingModel |
getSharingModel() |
Long |
getType() |
boolean |
inConflict(Placement placement)
Returns true if the given assignment is inconsistent with the existing
assignments respecting this constraint.
|
boolean |
isAvailable(int slot) |
boolean |
isAvailable(Lecture lecture,
TimeLocation time,
Long scheduler) |
boolean |
isConsistent(Placement p1,
Placement p2)
Returns true if the given assignments are consistent respecting this
constraint.
|
protected void |
printUsage(StringBuffer sb)
Room usage
|
void |
setCoordinates(Double x,
Double y)
Position of the building
|
void |
setNotAvailable(Placement placement) |
void |
setType(Long type) |
String |
toString() |
void |
unassigned(long iteration,
Placement placement)
Given value is unassigned from its variable.
|
addConstraintListener, addVariable, assignedVariables, compareTo, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, hashCode, isHard, removeConstraintListener, removeVariable, setModel, variables
public RoomConstraint(Long id, String name, Long buildingId, int capacity, RoomSharingModel roomSharingModel, Double x, Double y, boolean ignoreTooFar, boolean constraint)
public void setNotAvailable(Placement placement)
public boolean isAvailable(int slot)
public boolean isAvailable(Lecture lecture, TimeLocation time, Long scheduler)
public List<Placement>[] getAvailableArray()
public RoomSharingModel getSharingModel()
public Long getResourceId()
public Long getBuildingId()
public String getRoomName()
public int getCapacity()
public Placement getPlacement(int slot, int day)
public void computeConflicts(Placement placement, Set<Placement> conflicts)
Constraint
computeConflicts
in class Constraint<Lecture,Placement>
placement
- value to be assigned to its varaibleconflicts
- resultant set of conflicting valuespublic boolean inConflict(Placement placement)
Constraint
MacPropagation
).inConflict
in class Constraint<Lecture,Placement>
public boolean isConsistent(Placement p1, Placement p2)
Constraint
MacPropagation
).isConsistent
in class Constraint<Lecture,Placement>
public void assigned(long iteration, Placement placement)
Constraint
assigned
in class Constraint<Lecture,Placement>
public void unassigned(long iteration, Placement placement)
Constraint
unassigned
in class Constraint<Lecture,Placement>
public List<Placement> getResource(int slot)
public Placement[] getResourceOfWeek(int startDay)
protected void printUsage(StringBuffer sb)
public void setCoordinates(Double x, Double y)
public boolean getIgnoreTooFar()
public boolean getConstraint()