From 18b0cf641eeba13e97e98da31aec980fa3fafde3 Mon Sep 17 00:00:00 2001 From: tomas-muller Date: Wed, 15 Mar 2023 18:16:15 +0100 Subject: [PATCH] Student Scheduling: Course Request Priorities - added LC priority level (as the very first one) - to be used for courses with LC reservations (by setting Load.LCRequestPriority=LC) - this will ensure that LC courses are assigned first --- src/org/cpsolver/studentsct/StudentSectioningModel.java | 3 +++ src/org/cpsolver/studentsct/model/Request.java | 1 + 2 files changed, 4 insertions(+) diff --git a/src/org/cpsolver/studentsct/StudentSectioningModel.java b/src/org/cpsolver/studentsct/StudentSectioningModel.java index 2d8cc7fe..7419af20 100644 --- a/src/org/cpsolver/studentsct/StudentSectioningModel.java +++ b/src/org/cpsolver/studentsct/StudentSectioningModel.java @@ -1433,6 +1433,8 @@ public String toString(Assignment assignment) { if (sp.ordinal() < StudentPriority.Normal.ordinal()) { if (iTotalPriorityCRWeight[sp.ordinal()] > 0.0) priority += sp.code() + "PCR:" + sDecimalFormat.format(100.0 * getContext(assignment).iAssignedPriorityCRWeight[sp.ordinal()] / iTotalPriorityCRWeight[sp.ordinal()]) + "%, "; + if (iTotalPriorityCriticalCRWeight[RequestPriority.LC.ordinal()][sp.ordinal()] > 0.0) + priority += sp.code() + "PCL:" + sDecimalFormat.format(100.0 * getContext(assignment).iAssignedPriorityCriticalCRWeight[RequestPriority.LC.ordinal()][sp.ordinal()] / iTotalPriorityCriticalCRWeight[RequestPriority.LC.ordinal()][sp.ordinal()]) + "%, "; if (iTotalPriorityCriticalCRWeight[RequestPriority.Critical.ordinal()][sp.ordinal()] > 0.0) priority += sp.code() + "PCC:" + sDecimalFormat.format(100.0 * getContext(assignment).iAssignedPriorityCriticalCRWeight[RequestPriority.Critical.ordinal()][sp.ordinal()] / iTotalPriorityCriticalCRWeight[RequestPriority.Critical.ordinal()][sp.ordinal()]) + "%, "; if (iTotalPriorityCriticalCRWeight[RequestPriority.Important.ordinal()][sp.ordinal()] > 0.0) @@ -1447,6 +1449,7 @@ public String toString(Assignment assignment) { + (getNrLastLikeStudents(false) > 0 ? "DS:" + getNrCompleteLastLikeStudents(assignment, false) + "/" + getNrLastLikeStudents(false) + ", " : "") + (iTotalCRWeight > 0.0 ? "CR:" + sDecimalFormat.format(100.0 * getContext(assignment).getAssignedCourseRequestWeight() / iTotalCRWeight) + "%, " : "") + (iTotalSelCRWeight > 0.0 ? "S:" + sDoubleFormat.format(100.0 * (0.3 * getContext(assignment).iAssignedSelectedConfigWeight + 0.7 * getContext(assignment).iAssignedSelectedSectionWeight) / iTotalSelCRWeight) + "%, ": "") + + (iTotalCriticalCRWeight[RequestPriority.LC.ordinal()] > 0.0 ? "LC:" + sDecimalFormat.format(100.0 * getContext(assignment).getAssignedCriticalCourseRequestWeight(RequestPriority.LC) / iTotalCriticalCRWeight[RequestPriority.LC.ordinal()]) + "%, " : "") + (iTotalCriticalCRWeight[RequestPriority.Critical.ordinal()] > 0.0 ? "CC:" + sDecimalFormat.format(100.0 * getContext(assignment).getAssignedCriticalCourseRequestWeight(RequestPriority.Critical) / iTotalCriticalCRWeight[RequestPriority.Critical.ordinal()]) + "%, " : "") + (iTotalCriticalCRWeight[RequestPriority.Important.ordinal()] > 0.0 ? "IC:" + sDecimalFormat.format(100.0 * getContext(assignment).getAssignedCriticalCourseRequestWeight(RequestPriority.Important) / iTotalCriticalCRWeight[RequestPriority.Important.ordinal()]) + "%, " : "") + (iTotalCriticalCRWeight[RequestPriority.Vital.ordinal()] > 0.0 ? "VC:" + sDecimalFormat.format(100.0 * getContext(assignment).getAssignedCriticalCourseRequestWeight(RequestPriority.Vital) / iTotalCriticalCRWeight[RequestPriority.Vital.ordinal()]) + "%, " : "") diff --git a/src/org/cpsolver/studentsct/model/Request.java b/src/org/cpsolver/studentsct/model/Request.java index c72908e8..08eea2db 100644 --- a/src/org/cpsolver/studentsct/model/Request.java +++ b/src/org/cpsolver/studentsct/model/Request.java @@ -282,6 +282,7 @@ public boolean isCritical() { * and to assign requests of a higher priority first (before requests of a lower priority). */ public static enum RequestPriority { + LC("l", 1.0), Critical("c", 1.0), Vital("v", 0.8), Important("i", 0.5),