|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.cpsolver.ifs.model.Constraint<Exam,ExamPlacement>
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,
Double coordX,
Double coordY)
Constructor |
|
| Method Summary | |
|---|---|
void |
afterAssigned(long iteration,
ExamPlacement p)
An exam was assigned, update room assignment table |
void |
afterUnassigned(long iteration,
ExamPlacement p)
An exam was unassigned, update room assignment table |
void |
assigned(long iteration,
ExamPlacement p)
An exam was assigned, update room assignment table |
int |
compareTo(Constraint<Exam,ExamPlacement> o)
Compare two rooms (by unique id) |
void |
computeConflicts(ExamPlacement p,
Set<ExamPlacement> 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) |
Double |
getCoordX()
X coordinate |
Double |
getCoordY()
Y coordinate |
double |
getDistanceInMeters(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)
Deprecated. If room sharing is allowed, this method only returns first exam. Use getPlacements(ExamPeriod) instead. |
List<ExamPlacement> |
getPlacements(ExamPeriod period)
Exams placed at the given period |
ExamRoomSharing |
getRoomSharing()
|
int |
getSize()
Normal seating capacity (to be used when Exam.hasAltSeating() is
false) |
int |
hashCode()
Hash code |
boolean |
hasName()
Room name |
boolean |
inConflict(ExamPlacement p)
Checks whether there is a conflict between the given assignment of an exam and all the current assignments (of this room) |
boolean |
isAvailable()
True if the room is available during at least one period, |
boolean |
isAvailable(ExamPeriod period)
True if the room is available (for examination timetabling) during the given period |
boolean |
isAvailable(int period)
|
boolean |
isConsistent(ExamPlacement p1,
ExamPlacement p2)
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,
ExamPlacement p)
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,
Double coordX,
Double 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 coordinate| Method Detail |
|---|
public double getDistanceInMeters(ExamRoom other)
DistanceMetric
other - another room
public int getSize()
Exam.hasAltSeating() is
false)
public int getAltSize()
Exam.hasAltSeating() is true)
public Double getCoordX()
public Double getCoordY()
@Deprecated public ExamPlacement getPlacement(ExamPeriod period)
getPlacements(ExamPeriod) instead.
period - a period
public List<ExamPlacement> getPlacements(ExamPeriod period)
period - a period
public boolean isAvailable(ExamPeriod period)
period - a period
public boolean isAvailable(int period)
public boolean isAvailable()
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 otherwise
public 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 ExamRoomSharing getRoomSharing()
public void computeConflicts(ExamPlacement p,
Set<ExamPlacement> conflicts)
computeConflicts in class Constraint<Exam,ExamPlacement>p - value to be assigned to its varaibleconflicts - resultant set of conflicting valuespublic boolean inConflict(ExamPlacement p)
inConflict in class Constraint<Exam,ExamPlacement>
public boolean isConsistent(ExamPlacement p1,
ExamPlacement p2)
isConsistent in class Constraint<Exam,ExamPlacement>
public void assigned(long iteration,
ExamPlacement p)
assigned in class Constraint<Exam,ExamPlacement>
public void afterAssigned(long iteration,
ExamPlacement p)
public void unassigned(long iteration,
ExamPlacement p)
unassigned in class Constraint<Exam,ExamPlacement>
public void afterUnassigned(long iteration,
ExamPlacement p)
public boolean equals(Object o)
equals in class Constraint<Exam,ExamPlacement>public int hashCode()
hashCode in class Constraint<Exam,ExamPlacement>public String getName()
getName in class Constraint<Exam,ExamPlacement>public boolean hasName()
public String toString()
toString in class Objectpublic int compareTo(Constraint<Exam,ExamPlacement> o)
compareTo in interface Comparable<Constraint<Exam,ExamPlacement>>compareTo in class Constraint<Exam,ExamPlacement>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||