We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2acae82 commit 23ce5e0Copy full SHA for 23ce5e0
lib/evolvable/community.rb
@@ -97,6 +97,18 @@ def populations_by_name
97
@populations_by_name ||= self.class.populations_by_name.dup
98
end
99
100
+ # Returns an array of population instances
101
+ # @return [Array] An array of population instances
102
+ def populations
103
+ populations_by_name.values
104
+ end
105
+
106
+ # Evolves all populations in the community
107
+ # @return [void]
108
+ def evolve(...)
109
+ populations.each { |population| population.evolve(...) }
110
111
112
# Resets the populations hash to an empty hash
113
# @return [Hash] An empty hash
114
def reset_populations
0 commit comments