Class: Sangaku::Star
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #center ⇒ Object
- #fitness ⇒ Object
-
#initialize(center, size) ⇒ Star
constructor
A new instance of Star.
Constructor Details
Instance Method Details
#<=>(other) ⇒ Object
19 20 21 |
# File 'lib/sangaku/star.rb', line 19 def <=>(other) other.fitness <=> fitness end |
#center ⇒ Object
11 12 13 |
# File 'lib/sangaku/star.rb', line 11 def center @center end |
#fitness ⇒ Object
15 16 17 |
# File 'lib/sangaku/star.rb', line 15 def fitness @fitness ||= (@size.w * @size.h)/(1+0.1*(@size.w-@size.h).abs) end |