(no title)
cchianel | 3 months ago
var score = 0;
for (var shiftA : solution.getShifts()) {
for (var shiftB : solution.getShifts()) {
if (shiftA != shiftB && shiftA.getEmployee() == shiftB.getEmployee() && shiftA.overlaps(shiftB)) {
score -= 1;
}
}
}
return score
usually takes shift * shift evaluations of overlaps, we only check the shifts affected by the change (changing it from O(N^2) to O(1) usually).That being said, it might be useful for a move selector. I need to give it a more in depth reading.
abhgh|3 months ago
[1] https://willieneis.github.io/bax-website/