public class TeachingRequest extends Object
Modifier and Type | Class and Description |
---|---|
class |
TeachingRequest.Variable
Single instructor assignment to this teaching request
|
Constructor and Description |
---|
TeachingRequest(long requestId,
int nrVariables,
Course course,
float load,
Collection<Section> sections,
int sameCoursePreference,
int sameCommonPreference)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addAttributePreference(Preference<Attribute> pref)
Add attribute preference
|
void |
addInstructorPreference(Preference<Instructor> pref)
Add instructor preference
|
double |
countBackToBacks(TeachingRequest request,
double diffRoomWeight,
double diffTypeWeight)
Average value of the back-to-backs between this request and the given one
|
double |
countSameDays(TeachingRequest request,
double diffRoomWeight,
double diffTypeWeight)
Average value of the same days between this request and the given one
|
double |
countSameRooms(TeachingRequest request,
double diffTypeWeight)
Average value of the same rooms between this request and the given one
|
boolean |
equals(Object o) |
PreferenceCombination |
getAttributePreference(Instructor instructor)
Compute attribute preference for the given instructor
|
int |
getAttributePreference(Instructor instructor,
Attribute.Type type)
Compute attribute preference for the given instructor and attribute type
|
List<Preference<Attribute>> |
getAttributePreferences()
Return attribute preferences for this request
|
Course |
getCourse()
Course of the request that was provided in the constructor
|
Preference<Instructor> |
getInstructorPreference(Instructor instructor)
Return instructor preference for the given instructor
|
List<Preference<Instructor>> |
getInstructorPreferences()
Return instructor preferences for this request
|
float |
getLoad()
Return teaching load of the request
|
int |
getNrInstructors()
Get number of instructors needed
|
long |
getRequestId()
Teaching request id that was provided in the constructor
|
double |
getSameCommonPenalty(TeachingRequest request)
Return same common penalty of this request and the given request being assigned to the same instructor
|
int |
getSameCommonPreference()
Whether to ensure that multiple assignments given to the same instructor share the common part.
|
double |
getSameCoursePenalty(TeachingRequest request)
Return same course penalty of this request and the given request being assigned to the same instructor
|
int |
getSameCoursePreference()
Preference of an instructor taking this request together with some other request of the same / different course.
|
List<Section> |
getSections()
Sections of the request that was provided in the constructor
|
TeachingRequest.Variable |
getVariable(int index)
Get single instructor assignment variable
|
TeachingRequest.Variable[] |
getVariables()
Get single instructor assignment variables
|
int |
hashCode() |
boolean |
isSameCommonProhibited()
Is same common prohibited?
|
boolean |
isSameCommonRequired()
Is same common required?
|
boolean |
isSameCommonViolated(TeachingRequest request)
Check if this request and the given one can be assigned to the same instructor without violating the same common constraint
|
boolean |
isSameCourseProhibited()
Is same course prohibited?
|
boolean |
isSameCourseRequired()
Is same course required?
|
boolean |
isSameCourseViolated(TeachingRequest request)
Check if this request and the given one can be assigned to the same instructor without violating the same course constraint
|
double |
nrSameLectures(TeachingRequest request)
Count the number of common sections that the given request share with this request
|
boolean |
overlaps(TeachingRequest request)
Check if this request overlaps with the given one
|
boolean |
sameCommon(TeachingRequest request)
Check if the given request fully share the common sections with this request
|
boolean |
sameCourse(TeachingRequest request)
Check if this request and the given request are of the same course
|
void |
setLoad(float load)
Set teaching load of the request
|
int |
share(TeachingRequest request)
Count the number of (allowed) overlapping time slots between this request and the given one
|
int |
share(TimeLocation time)
Count the number of overlapping time slots between this request and the given time
|
boolean |
shareCommon(TeachingRequest request)
Check if the given request (partially) share the common sections with this request
|
String |
toString() |
public TeachingRequest(long requestId, int nrVariables, Course course, float load, Collection<Section> sections, int sameCoursePreference, int sameCommonPreference)
requestId
- teaching request idnrVariables
- number of instructors for this teaching requestcourse
- courseload
- teaching loadsections
- list of sectionssameCoursePreference
- same course preferencesameCommonPreference
- same common preference (two requests of the same course share the common part)public long getRequestId()
public int getSameCoursePreference()
public boolean isSameCourseRequired()
public boolean isSameCourseProhibited()
public int getSameCommonPreference()
Section.isCommon()
).public boolean isSameCommonRequired()
public boolean isSameCommonProhibited()
public TeachingRequest.Variable[] getVariables()
public TeachingRequest.Variable getVariable(int index)
index
- index of the variablepublic int getNrInstructors()
public List<Preference<Attribute>> getAttributePreferences()
public void addAttributePreference(Preference<Attribute> pref)
pref
- attribute preferencepublic int getAttributePreference(Instructor instructor, Attribute.Type type)
instructor
- an instructortype
- an attribute typeAttribute.Type.isConjunctive()
and Attribute.Type.isRequired()
propertiespublic PreferenceCombination getAttributePreference(Instructor instructor)
instructor
- an instructorSumPreferenceCombination
for the preferences of each attribute type (using getAttributePreference(Instructor, org.cpsolver.instructor.model.Attribute.Type)
)public List<Preference<Instructor>> getInstructorPreferences()
public void addInstructorPreference(Preference<Instructor> pref)
pref
- instructor preferencepublic Preference<Instructor> getInstructorPreference(Instructor instructor)
instructor
- an instructorpublic Course getCourse()
public List<Section> getSections()
public float getLoad()
public void setLoad(float load)
load
- teaching loadpublic boolean sameCommon(TeachingRequest request)
request
- the other teaching requestpublic boolean shareCommon(TeachingRequest request)
request
- the other teaching requestpublic boolean isSameCommonViolated(TeachingRequest request)
request
- the other teaching requestpublic double getSameCommonPenalty(TeachingRequest request)
request
- the other teaching requestpublic double nrSameLectures(TeachingRequest request)
request
- the other teaching requestpublic boolean sameCourse(TeachingRequest request)
request
- the other teaching requestpublic boolean isSameCourseViolated(TeachingRequest request)
request
- the other teaching requestpublic double getSameCoursePenalty(TeachingRequest request)
request
- the other teaching requestpublic boolean overlaps(TeachingRequest request)
request
- the other teaching requestpublic int share(TeachingRequest request)
request
- the other teaching requestpublic int share(TimeLocation time)
time
- a timepublic double countBackToBacks(TeachingRequest request, double diffRoomWeight, double diffTypeWeight)
request
- the other teaching requestdiffRoomWeight
- different room penaltydiffTypeWeight
- different instructional type penaltySection.countBackToBacks(Collection, double, double)
between the two, common sections are ignoredpublic double countSameDays(TeachingRequest request, double diffRoomWeight, double diffTypeWeight)
request
- the other teaching requestdiffRoomWeight
- different room penaltydiffTypeWeight
- different instructional type penaltySection.countSameDays(Collection, double, double)
between the two, common sections are ignoredpublic double countSameRooms(TeachingRequest request, double diffTypeWeight)
request
- the other teaching requestdiffTypeWeight
- different instructional type penaltySection.countSameRooms(Collection, double)
between the two, common sections are ignored