|
||||||||||
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
public class RoomConstraint
Room constraint.
Classes with the same room can not overlap in time.
Field Summary |
---|
Fields inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
iAssignedVariables, iConstraintListeners, iId |
Constructor Summary | |
---|---|
RoomConstraint(Long id,
String name,
Long buildingId,
int capacity,
RoomSharingModel roomSharingModel,
Double x,
Double y,
boolean ignoreTooFar,
boolean constraint)
Constructor |
Method Summary | |
---|---|
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. |
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 RoomConstraint(Long id, String name, Long buildingId, int capacity, RoomSharingModel roomSharingModel, Double x, Double y, boolean ignoreTooFar, boolean constraint)
Method Detail |
---|
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 getName()
getName
in class Constraint<Lecture,Placement>
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 String toString()
toString
in class Object
public void setCoordinates(Double x, Double y)
public Double getPosX()
public Double getPosY()
public boolean getIgnoreTooFar()
public boolean getConstraint()
public Long getType()
public void setType(Long type)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |