class Sangaku::Star

Public Class Methods

new(center, size) click to toggle source
# File lib/sangaku/star.rb, line 7
def initialize(center, size)
  @center, @size = Point.new(*center), Point.new(*size)
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/sangaku/star.rb, line 19
def <=>(other)
  other.fitness <=> fitness
end
center() click to toggle source
# File lib/sangaku/star.rb, line 11
def center
  @center
end
fitness() click to toggle source
# File lib/sangaku/star.rb, line 15
def fitness
  @fitness ||= (@size.w * @size.h)/(1+0.1*(@size.w-@size.h).abs)
end