public class Instructor.Context extends Object implements AssignmentConstraintContext<TeachingRequest.Variable,TeachingAssignment>
Constructor and Description |
---|
Context(Assignment<TeachingRequest.Variable,TeachingAssignment> assignment)
Constructor
|
Context(Assignment<TeachingRequest.Variable,TeachingAssignment> assignment,
Instructor.Context parentContext)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
assigned(Assignment<TeachingRequest.Variable,TeachingAssignment> assignment,
TeachingAssignment value)
Called when
ConstraintWithContext.assigned(Assignment, long, Value) is called to update
the content of the context. |
int |
countAssignmentsWithTime()
Number of teaching assignments that have a time assignment of this instructor
|
double |
countBackToBackPercentage()
Current back-to-back percentage for this instructor
|
double |
countBackToBackPreference(double diffRoomWeight,
double diffTypeWeight)
Current back-to-back preference of the instructor (using
TeachingRequest.countBackToBacks(TeachingRequest, double, double) ) |
double |
countDifferentLectures()
Percentage of common sections that are not same for the instructor (using
TeachingRequest.nrSameLectures(TeachingRequest) ) |
double |
countSameCommonPenalty()
Compute same common penalty between all requests of this instructor
|
double |
countSameCoursePenalty()
Compute same course penalty between all requests of this instructor
|
double |
countSameDaysPercentage()
Current same days percentage for this instructor
|
double |
countSameDaysPreference(double diffRoomWeight,
double diffTypeWeight)
Current same days preference of the instructor (using
TeachingRequest.countSameDays(TeachingRequest, double, double) ) |
double |
countSameRoomPercentage()
Current same room percentage for this instructor
|
double |
countSameRoomPreference(double diffTypeWeight)
Current same room preference of the instructor (using
TeachingRequest.countSameRooms(TeachingRequest, double) ) |
int |
countTimeOverlaps()
If there are classes that allow for overlap, the number of such overlapping slots of this instructor
|
Set<TeachingAssignment> |
getAssignments()
Current assignments of this instructor
|
Instructor |
getInstructor()
Instructor
|
float |
getLoad()
Current load of this instructor
|
float |
getUnusedLoad()
Current unused load of this instructor
|
void |
unassigned(Assignment<TeachingRequest.Variable,TeachingAssignment> assignment,
TeachingAssignment value)
Called when
ConstraintWithContext.unassigned(Assignment, long, Value) is called to update
the content of the context. |
public Context(Assignment<TeachingRequest.Variable,TeachingAssignment> assignment)
assignment
- current assignmentpublic Context(Assignment<TeachingRequest.Variable,TeachingAssignment> assignment, Instructor.Context parentContext)
assignment
- current assignmentparentContext
- parent contextpublic Instructor getInstructor()
public void assigned(Assignment<TeachingRequest.Variable,TeachingAssignment> assignment, TeachingAssignment value)
AssignmentConstraintContext
ConstraintWithContext.assigned(Assignment, long, Value)
is called to update
the content of the context.assigned
in interface AssignmentConstraintContext<TeachingRequest.Variable,TeachingAssignment>
assignment
- current assignment (with which this context is associated)value
- assigned valuepublic void unassigned(Assignment<TeachingRequest.Variable,TeachingAssignment> assignment, TeachingAssignment value)
AssignmentConstraintContext
ConstraintWithContext.unassigned(Assignment, long, Value)
is called to update
the content of the context.unassigned
in interface AssignmentConstraintContext<TeachingRequest.Variable,TeachingAssignment>
assignment
- current assignment (with which this context is associated)value
- unassigned valuepublic Set<TeachingAssignment> getAssignments()
public float getLoad()
public float getUnusedLoad()
Instructor.getMaxLoad()
and getLoad()
otherwisepublic int countTimeOverlaps()
public int countAssignmentsWithTime()
public double countDifferentLectures()
TeachingRequest.nrSameLectures(TeachingRequest)
)public double countBackToBackPreference(double diffRoomWeight, double diffTypeWeight)
TeachingRequest.countBackToBacks(TeachingRequest, double, double)
)diffRoomWeight
- different room weightdiffTypeWeight
- different instructional type weightpublic double countBackToBackPercentage()
public double countSameDaysPreference(double diffRoomWeight, double diffTypeWeight)
TeachingRequest.countSameDays(TeachingRequest, double, double)
)diffRoomWeight
- different room weightdiffTypeWeight
- different instructional type weightpublic double countSameDaysPercentage()
public double countSameRoomPreference(double diffTypeWeight)
TeachingRequest.countSameRooms(TeachingRequest, double)
)diffTypeWeight
- different instructional type weightpublic double countSameRoomPercentage()
public double countSameCoursePenalty()
public double countSameCommonPenalty()