Skip to content

Commit a673e28

Browse files
committed
Update default size parameter in Population#initialize to 0
1 parent 9fd8365 commit a673e28

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Breaking Changes:
99
* Changed population initialization and evolvable creation workflow for more consistency.
1010
* Simplified error handling in favor of more single `Evolvable::Error` type with more informative messages.
1111
* Changed `Population#new_evolvables` to only accept a `count` parameter, removing the `evolvables` parameter.
12+
* Changed default `size` parameter in `Population#initialize` from 40 to 0.
1213

1314
New Features:
1415
* Added gene clusters for organizing related genes through the `cluster` parameter in gene definitions.

lib/evolvable/population.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def self.load(data)
6868
# @param evolvable_type [Class] Required. The class of evolvables to create
6969
# @param id [String, nil] Optional identifier, not used by Evolvable internally
7070
# @param name [String, nil] Optional name, not used by Evolvable internally
71-
# @param size [Integer] The number of instances in the population (default: 40)
71+
# @param size [Integer] The number of instances in the population (default: 0)
7272
# @param evolutions_count [Integer] The number of evolutions completed (default: 0)
7373
# @param gene_space [Evolvable::GeneSpace, nil] The gene space for initializing evolvables
7474
# @param parent_evolvables [Array<Evolvable>] Parent evolvables for breeding the next generation
@@ -83,7 +83,7 @@ def self.load(data)
8383
def initialize(evolvable_type:,
8484
id: nil,
8585
name: nil,
86-
size: 40,
86+
size: 0,
8787
evolutions_count: 0,
8888
gene_space: nil,
8989
parent_evolvables: [],

0 commit comments

Comments
 (0)