Class: ConnectedMeasure

Inherits:
Measure show all
Defined in:
lib/gimuby/genetic/archipelago/measure/connected_measure.rb

Overview

Return the number of connected class for an archipelago

Instance Method Summary collapse

Instance Method Details

#compute(archipelago) ⇒ Object

Parameters:



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/gimuby/genetic/archipelago/measure/connected_measure.rb', line 7

def compute(archipelago)
  init_connected_classes(archipelago)
  old_signature = get_state_signature
  new_signature = ''
  until old_signature == new_signature
    old_signature = new_signature
    try_to_reduce(archipelago)
    new_signature = get_state_signature
  end
  get_connected_classes_count
end