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)
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
|
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
|
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() |
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
|
String |
toString() |
public TeachingRequest(long requestId, int nrVariables, Course course, float load, Collection<Section> sections)
requestId
- teaching request idnrVariables
- number of instructors for this teaching requestcourse
- courseload
- teaching loadsections
- list of sectionspublic long getRequestId()
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 double nrSameLectures(TeachingRequest request)
request
- the other teaching requestpublic boolean sameCourse(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 ignoredCopyright © 2016 UniTime LLC. All Rights Reserved.