public class ExamRoomPlacement extends Object implements Comparable<ExamRoomPlacement>
ExamRoom and a penalty associated with a placement of an exam into
the given room. | Constructor and Description |
|---|
ExamRoomPlacement(ExamRoom room)
Constructor
|
ExamRoomPlacement(ExamRoom room,
int penalty)
Constructor
|
ExamRoomPlacement(ExamRoom room,
int penalty,
int maxPenalty)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(ExamRoomPlacement o)
Compare two room placements
|
boolean |
equals(Object o)
Compare two room placements for equality
|
double |
getDistanceInMeters(ExamRoomPlacement other)
Room distance
|
long |
getId()
Examination room id
|
int |
getMaxPenalty()
Maximal penalty imposed of
ExamRoom.getPenalty(ExamPeriod), i.e.,
a placement with greater penalty is not allowed to be made |
String |
getName()
Examination room name
|
int |
getPenalty()
Penalty for assignment of an exam into this room
Exam.getRoomPlacements() |
int |
getPenalty(ExamPeriod period)
Penalty for assignment of an exam into this room
Exam.getRoomPlacements() and the given examination period |
ExamRoom |
getRoom()
Examination room
|
int |
getSize(boolean altSeating)
Room size
|
int |
hashCode()
Hash code
|
boolean |
isAvailable(ExamPeriod period)
Examination room availability
|
void |
setMaxPenalty(int maxPenalty)
Maximal penalty imposed of
ExamRoom.getPenalty(ExamPeriod), i.e.,
a placement with greater penalty is not allowed to be made |
void |
setPenalty(int penalty)
Penalty for assignment of an exam into this room
Exam.getRoomPlacements() |
String |
toString() |
public ExamRoomPlacement(ExamRoom room)
room - examination roompublic ExamRoomPlacement(ExamRoom room, int penalty)
room - examination roompenalty - penalty for using this roompublic ExamRoomPlacement(ExamRoom room, int penalty, int maxPenalty)
room - examination roompenalty - penalty for using this roommaxPenalty - maximal penalty imposed of
ExamRoom.getPenalty(ExamPeriod), i.e., a placement
with greater penalty is not allowed to be madepublic long getId()
public boolean isAvailable(ExamPeriod period)
period - given periodpublic int getPenalty()
Exam.getRoomPlacements()public int getMaxPenalty()
ExamRoom.getPenalty(ExamPeriod), i.e.,
a placement with greater penalty is not allowed to be madepublic void setPenalty(int penalty)
Exam.getRoomPlacements()penalty - room assignment penaltypublic void setMaxPenalty(int maxPenalty)
ExamRoom.getPenalty(ExamPeriod), i.e.,
a placement with greater penalty is not allowed to be mademaxPenalty - maximal penaltypublic int getPenalty(ExamPeriod period)
Exam.getRoomPlacements() and the given examination periodperiod - given periodgetPenalty() +
ExamRoom.getPenalty(ExamPeriod)public int getSize(boolean altSeating)
altSeating - examination seating (pass Exam.hasAltSeating())public double getDistanceInMeters(ExamRoomPlacement other)
other - another placementExamRoom.getDistanceInMeters(ExamRoom)public int compareTo(ExamRoomPlacement o)
compareTo in interface Comparable<ExamRoomPlacement>