|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.cpsolver.exam.model.ExamPeriod
public class ExamPeriod
Representation of an examination period.
Examination timetabling model contains a list of non-overlapping examination periods.
Each period has a day, starting time and a length (in minutes) defined. Each exam
is to be assigned to one period that is available for the exam and that is of the same
of greater length than the exam.
A penalty weight (getPenalty()
) can be assigned to each period. It is used
to penalize unpopular examination times (e.g., evening or last-day).
A list of periods is to be defined using ExamModel.addPeriod(Long, String, String, int, int)
, inserting
periods in the order of increasing days and times.
Constructor Summary | |
---|---|
ExamPeriod(Long id,
String day,
String time,
int length,
int penalty)
Constructor |
Method Summary | |
---|---|
int |
compareTo(Object o)
|
boolean |
equals(Object o)
|
int |
getDay()
Day index |
String |
getDayStr()
Day string, e.g., 07/12/10 |
Long |
getId()
Period unique identifier |
int |
getIndex()
Period index |
int |
getLength()
Length of period in minutes |
int |
getPenalty()
Period weight to be used to penalize unpopular periods |
int |
getTime()
Time index |
String |
getTimeStr()
Time string, e.g., 8:00am-10:00am |
int |
hashCode()
|
ExamPeriod |
next()
Next period |
ExamPeriod |
prev()
Previous period |
void |
setId(Long id)
Period unique identifier |
void |
setIndex(int index,
int day,
int time)
Set priod indexes (only to be used by ExamModel.addPeriod(Long, String, String, int, int) ) |
void |
setNext(ExamPeriod next)
Set next period (only to be used by ExamModel.addPeriod(Long, String, String, int, int) ) |
void |
setPrev(ExamPeriod prev)
Set previous period (only to be used by ExamModel.addPeriod(Long, String, String, int, int) ) |
String |
toDebugString()
String representation for debuging purposes |
String |
toString()
String representation |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ExamPeriod(Long id, String day, String time, int length, int penalty)
id
- period unique identifierday
- day (e.g., 07/12/10)time
- (e.g., 8:00am-10:00am)length
- length of period in minutespenalty
- penalization of using this periodMethod Detail |
---|
public Long getId()
public void setId(Long id)
public String getDayStr()
public int getDay()
public String getTimeStr()
public int getTime()
public int getLength()
public int getIndex()
public int getPenalty()
public ExamPeriod prev()
public ExamPeriod next()
public void setIndex(int index, int day, int time)
ExamModel.addPeriod(Long, String, String, int, int)
)
index
- period indexday
- day indextime
- time indexpublic void setPrev(ExamPeriod prev)
ExamModel.addPeriod(Long, String, String, int, int)
)
prev
- previous periodpublic void setNext(ExamPeriod next)
ExamModel.addPeriod(Long, String, String, int, int)
)
next
- next periodpublic String toString()
toString
in class Object
public String toDebugString()
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
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 |