Skip to content

Instantly share code, notes, and snippets.

@Vaguery
Created November 29, 2009 20:22
Show Gist options
  • Save Vaguery/245050 to your computer and use it in GitHub Desktop.
Save Vaguery/245050 to your computer and use it in GitHub Desktop.
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