Skip to content

Instantly share code, notes, and snippets.

@jalada
Created April 10, 2012 11:03
Show Gist options
  • Save jalada/2350481 to your computer and use it in GitHub Desktop.
Save jalada/2350481 to your computer and use it in GitHub Desktop.
module DNA
def self.points
raw_points = 1000.times.map do |p|
5.times.map do |c|
Random.rand(100)
end
end
raw_points.map{|p| KDTree::Point.new(p)}
end
def self.tree
@tree ||= KDTree.new(self.points)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment