From 514bd75d87fba4b99f1320d82021365b448d1bf8 Mon Sep 17 00:00:00 2001 From: tomas-muller Date: Thu, 14 Jun 2018 09:34:02 +0200 Subject: [PATCH] Student Scheduling: Solution Info - Assigned course requests: exclude alternative course requests from the total (100% means all students have a complete schedule) --- .../cpsolver/studentsct/StudentSectioningModel.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/org/cpsolver/studentsct/StudentSectioningModel.java b/src/org/cpsolver/studentsct/StudentSectioningModel.java index bc6dbace..a9480c1b 100644 --- a/src/org/cpsolver/studentsct/StudentSectioningModel.java +++ b/src/org/cpsolver/studentsct/StudentSectioningModel.java @@ -242,12 +242,12 @@ public void addStudent(Student student) { @Override public void addVariable(Request request) { super.addVariable(request); - if (request instanceof CourseRequest) + if (request instanceof CourseRequest && !request.isAlternative()) iTotalCRWeight += request.getWeight(); if (request.getStudent().isDummy()) { iNrDummyRequests++; iTotalDummyWeight += request.getWeight(); - if (request instanceof CourseRequest) + if (request instanceof CourseRequest && !request.isAlternative()) iTotalDummyCRWeight += request.getWeight(); } if (request.isMPP()) @@ -299,14 +299,14 @@ public void removeVariable(Request request) { if (request.getStudent().isDummy()) { iNrDummyRequests--; iTotalDummyWeight -= request.getWeight(); - if (request instanceof CourseRequest) + if (request instanceof CourseRequest && !request.isAlternative()) iTotalDummyCRWeight -= request.getWeight(); } if (request.isMPP()) iTotalMPPCRWeight -= request.getWeight(); if (request.hasSelection()) iTotalSelCRWeight -= request.getWeight(); - if (request instanceof CourseRequest) + if (request instanceof CourseRequest && !request.isAlternative()) iTotalCRWeight -= request.getWeight(); } @@ -1145,12 +1145,12 @@ public void requestWeightsChanged(Assignment assignment) { iAssignedNoTimeSectionWeight = 0.0; for (Request request: variables()) { boolean cr = (request instanceof CourseRequest); - if (cr) + if (cr && !request.isAlternative()) iTotalCRWeight += request.getWeight(); if (request.getStudent().isDummy()) { iTotalDummyWeight += request.getWeight(); iNrDummyRequests ++; - if (cr) + if (cr && !request.isAlternative()) iTotalDummyCRWeight += request.getWeight(); } if (request.isMPP())