Created
November 29, 2009 20:22
-
-
Save Vaguery/245050 to your computer and use it in GitHub Desktop.
This file contains 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
def domination_classes(crowd, template = all_shared_scores(crowd)) | |
result = Hash.new() | |
crowd.each_index do |i| | |
dominatedBy = 0 | |
crowd.each_index do |j| | |
dominatedBy += 1 if crowd[i].dominated_by?(crowd[j], template) | |
end | |
result[dominatedBy] ||= [] | |
result[dominatedBy].push crowd[i] | |
end | |
return result | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment