Permalink
Browse files

fix the wrong array constructor

  • Loading branch information...
1 parent e2d718f commit e43fe45e38d806b8d7de527a2b2650479d9e2cf3 @raincole raincole committed May 23, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/algorithms/evolutionary/evolution_strategies.rb
@@ -55,7 +55,7 @@ def init_population(minmax, pop_size)
strategy = Array.new(minmax.size) do |i|
[0, (minmax[i][1]-minmax[i][0]) * 0.05]
end
- pop = Array.new(pop_size, {})
+ pop = Array.new(pop_size) { Hash.new }
pop.each_index do |i|
pop[i][:vector] = random_vector(minmax)
pop[i][:strategy] = random_vector(strategy)

0 comments on commit e43fe45

Please sign in to comment.