|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.cpsolver.ifs.model.Constraint 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,
int x,
int y,
boolean ignoreTooFar,
boolean constraint)
Constructor |
Method Summary | |
---|---|
void |
assigned(long iteration,
Value value)
Given value is to be assigned to its varable. |
void |
clearCache()
|
void |
computeConflicts(Value value,
Set conflicts)
The only method which has to be implemented by any constraint. |
int |
countUselessSlots()
Number of useless slots for this room |
int |
countUselessSlots(Placement placement)
Number of useless slots for this room |
int |
countUselessSlotsBrokenTimePatterns()
Number of useless slots for this room |
int |
countUselessSlotsHalfHours()
Number of useless slots for this room |
Vector[] |
getAvailableArray()
|
Long |
getBuildingId()
Building id |
int |
getCapacity()
Capacity |
boolean |
getConstraint()
|
boolean |
getIgnoreTooFar()
|
String |
getName()
Room name |
Placement |
getPlacement(int slot,
int day)
|
int |
getPosX()
X-position of the building |
int |
getPosY()
Y-position of the building |
Vector |
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(Value value)
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(Value value1,
Value value2)
Returns true if the given assignments are consistent respecting this constraint. |
protected void |
printUsage(StringBuffer sb)
Room usage |
void |
setCoordinates(int x,
int y)
Position of the building |
void |
setNotAvailable(Placement placement)
|
void |
setType(Long type)
|
String |
toString()
|
void |
unassigned(long iteration,
Value value)
Given value is unassigned from its varable. |
Methods inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
addConstraintListener, addVariable, assignedVariables, 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, int x, int 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 Vector[] getAvailableArray()
public RoomSharingModel getSharingModel()
public Long getResourceId()
public Long getBuildingId()
public String getName()
getName
in class Constraint
public String getRoomName()
public int getCapacity()
public Placement getPlacement(int slot, int day)
public void computeConflicts(Value value, Set conflicts)
Constraint
computeConflicts
in class Constraint
value
- value to be assigned to its varaibleconflicts
- resultant set of conflicting valuespublic boolean inConflict(Value value)
Constraint
MacPropagation
).
inConflict
in class Constraint
public boolean isConsistent(Value value1, Value value2)
Constraint
MacPropagation
).
isConsistent
in class Constraint
public void assigned(long iteration, Value value)
Constraint
assigned
in class Constraint
public void unassigned(long iteration, Value value)
Constraint
unassigned
in class Constraint
public Vector getResource(int slot)
public Placement[] getResourceOfWeek(int startDay)
public int countUselessSlots()
public int countUselessSlotsHalfHours()
public int countUselessSlotsBrokenTimePatterns()
public void clearCache()
public int countUselessSlots(Placement placement)
protected void printUsage(StringBuffer sb)
public String toString()
toString
in class Object
public void setCoordinates(int x, int y)
public int getPosX()
public int 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 |