Ignore:
Timestamp:
03/18/14 17:00:11 (11 years ago)
Author:
Maciej Komosinski
Message:

Avoid costly calls to best() in each simulation step

File:
1 edited

Legend:

Unmodified
Added
Removed
  • experiments/frams/evolve-speed-vs-gravity/data/scripts/evolve-speed-vs-gravity.script

    r118 r184  
    2828        while (Simulator.running && best.popsiz<min_evaluations) //repeat until the best genotype will be evaluated at least min_evaluations times
    2929        {
    30                 Simulator.step();
     30                for(var t=best.lifespan; t>0 && Simulator.running; t--)
     31                        Simulator.step(); // simulate 'expected lifespan' steps after which 'best' may have changed. This helps avoid too frequent calls to best()
    3132                best=GenePools[0].best();
    3233        }
Note: See TracChangeset for help on using the changeset viewer.