We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 22fef1a commit cb65d42Copy full SHA for cb65d42
Course Scheduler/Services/GeneticAlgorithm.cs
@@ -75,11 +75,12 @@ private int PenaltyOfMaximumCountOfClassInSection(List<CourseTeacherClassTime> c
75
var sectionAndCount = sections.GroupBy(x => x)
76
.Select(g => new { Value = g.Key, Count = g.Count() });
77
78
+ var maximumCountOfClass = 3;
79
foreach (var section in sectionAndCount)
80
{
- if (section.Count > 3)
81
+ if (section.Count > maximumCountOfClass)
82
- penalty += section.Count - 3;
83
+ penalty += (section.Count - maximumCountOfClass);
84
}
85
86
return penalty;
0 commit comments