Last active
January 24, 2017 11:06
-
-
Save ge0ffrey/7fe165c5343076ae9d30da55c6e8b093 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rule "fairAssignmentCountPerTeam" | |
when | |
accumulate( | |
$t : Team() | |
and accumulate( | |
$a : TeamAssignment(team == $t); | |
$teamTotal : count($a) | |
); | |
$total : sum($teamTotal.intValue() * $teamTotal.intValue()) | |
) | |
then | |
scoreHolder.addMediumConstraintMatch(kcontext, - (int) (Math.sqrt($total) * 1000.0)); | |
end | |
// Can we turn this into 1 accumulate? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment