Skip to content

Commit

Permalink
Student Scheduling: Solution Info
Browse files Browse the repository at this point in the history
- Assigned course requests: exclude alternative course requests from the total
  (100% means all students have a complete schedule)
  • Loading branch information
tomas-muller committed Jun 14, 2018
1 parent 889ccf1 commit 514bd75
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/org/cpsolver/studentsct/StudentSectioningModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -1145,12 +1145,12 @@ public void requestWeightsChanged(Assignment<Request, Enrollment> 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())
Expand Down

0 comments on commit 514bd75

Please sign in to comment.