|
||||||||||
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.exam.model.ExamRoom
public class ExamRoom
A room. Only one exam can use a room at a time (period).
Field Summary |
---|
Fields inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
iAssignedVariables, iConstraintListeners, iId |
Constructor Summary | |
---|---|
ExamRoom(ExamModel model,
long id,
String name,
int size,
int altSize,
int coordX,
int coordY)
Constructor |
Method Summary | |
---|---|
void |
afterAssigned(long iteration,
Value value)
An exam was assigned, update room assignment table |
void |
afterUnassigned(long iteration,
Value value)
An exam was unassigned, update room assignment table |
void |
assigned(long iteration,
Value value)
An exam was assigned, update room assignment table |
int |
compareTo(Object o)
Compare two rooms (by unique id) |
void |
computeConflicts(Value value,
Set conflicts)
Compute conflicts between the given assignment of an exam and all the current assignments (of this room) |
boolean |
equals(Object o)
Checks two rooms for equality |
int |
getAltSize()
Alternating seating capacity (to be used when Exam.hasAltSeating() is true) |
int |
getCoordX()
X coordinate |
int |
getCoordY()
Y coordinate |
int |
getDistance(ExamRoom other)
Distance between two rooms. |
String |
getName()
Room name |
int |
getPenalty(ExamPeriod period)
Return room penalty for given period |
int |
getPenalty(int period)
|
ExamPlacement |
getPlacement(ExamPeriod period)
An exam placed at the given period |
int |
getSize()
Normal seating capacity (to be used when Exam.hasAltSeating() is false) |
int |
hashCode()
Hash code |
boolean |
hasName()
Room name |
boolean |
inConflict(Value value)
Checks whether there is a conflict between the given assignment of an exam and all the current assignments (of this room) |
boolean |
isAvailable(ExamPeriod period)
True if the room is available (for examination timetabling) during the given period |
boolean |
isAvailable(int period)
|
boolean |
isConsistent(Value value1,
Value value2)
False if the given two assignments are using this room at the same period |
void |
setAvailable(ExamPeriod period,
boolean available)
Set whether the room is available (for examination timetabling) during the given period |
void |
setAvailable(int period,
boolean available)
|
void |
setPenalty(ExamPeriod period,
int penalty)
Set room penalty for given period |
void |
setPenalty(int period,
int penalty)
|
String |
toString()
Room unique id |
void |
unassigned(long iteration,
Value value)
An exam was unassigned, update room assignment table |
Methods inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
addConstraintListener, addVariable, assignedVariables, constraintListeners, countAssignedVariables, countVariables, getDescription, getId, getModel, isHard, removeConstraintListener, removeVariable, setModel, variables |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ExamRoom(ExamModel model, long id, String name, int size, int altSize, int coordX, int coordY)
model
- examination timetabling modelid
- unique idsize
- room (normal) seating capacityaltSize
- room alternating seating capacity (to be used when Exam.hasAltSeating()
is true)coordX
- x coordinatecoordY
- y coordinateMethod Detail |
---|
public int getDistance(ExamRoom other)
other
- another room
public int getSize()
Exam.hasAltSeating()
is false)
public int getAltSize()
Exam.hasAltSeating()
is true)
public int getCoordX()
public int getCoordY()
public ExamPlacement getPlacement(ExamPeriod period)
period
- a period
public boolean isAvailable(ExamPeriod period)
period
- a period
public boolean isAvailable(int period)
public void setAvailable(ExamPeriod period, boolean available)
period
- a periodavailable
- true if an exam can be scheduled into this room at the given period, false if otherwisepublic void setAvailable(int period, boolean available)
public int getPenalty(ExamPeriod period)
public int getPenalty(int period)
public void setPenalty(ExamPeriod period, int penalty)
public void setPenalty(int period, int penalty)
public void computeConflicts(Value value, Set conflicts)
computeConflicts
in class Constraint
value
- value to be assigned to its varaibleconflicts
- resultant set of conflicting valuespublic boolean inConflict(Value value)
inConflict
in class Constraint
public boolean isConsistent(Value value1, Value value2)
isConsistent
in class Constraint
public void assigned(long iteration, Value value)
assigned
in class Constraint
public void afterAssigned(long iteration, Value value)
public void unassigned(long iteration, Value value)
unassigned
in class Constraint
public void afterUnassigned(long iteration, Value value)
public boolean equals(Object o)
equals
in class Constraint
public int hashCode()
hashCode
in class Constraint
public String getName()
getName
in class Constraint
public boolean hasName()
public String toString()
toString
in class Object
public int compareTo(Object o)
compareTo
in interface Comparable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |