Changeset 462 for experiments


Ignore:
Timestamp:
02/03/16 23:12:23 (9 years ago)
Author:
Maciej Komosinski
Message:
  • Updated for a new official way of calling scripts with arguments
  • Prints more comprehensive statistics
File:
1 edited

Legend:

Unmodified
Added
Removed
  • experiments/frams/multi-threading/data/scripts/test-mt.script

    r116 r462  
    33help:Multithreading efficiency test
    44code:~
    5 function main(complexify_geno,timeinterval,intervals)
     5function main_args(complexify_geno,timeinterval,intervals)
    66{
    77        // ExpParams.mix_period (percentage of the gene pool capacity) is kept at the default value (1000%)
     
    1717        //Simulator.print(GenePools[0][0].genotype); //ensure that the initialgen is in the gene pool - init() does this
    1818               
     19        var t0=Math.time;
     20        var next_pause;
    1921        Simulator.start();
    2022        for(var iter=0;iter<intervals;iter++)
    2123        {
    22                 var t0=Math.time;
    23                 while (Math.time-t0<timeinterval && Simulator.running) Simulator.step();
    24                 Simulator.print("iter=%d, simsteps=%d, evals=%d, migrations=%d, gen_count=%d, avg_numparts=%g, fit_avg=%g, fit_max=%g" % iter % Simulator.time % ExpState.totaltests % ExpState.migrations % stats.gen_count % stats.st_avg_numparts % stats.st_avg_fit % stats.st_max_fit);
     24                next_pause=Math.time+timeinterval;
     25                while (Math.time<next_pause && Simulator.running) Simulator.step();
     26                if (iter==(intervals-1))
     27                    Simulator.stop();
     28                Simulator.print("iter=%d, simsteps=%d, evals=%d, migrations=%d, gen_count=%d, avg_numparts=%g, fit_avg=%g, fit_max=%g, time=%f, migration_time=%f, T=%d, C=%d" % iter % Simulator.stepNumber % ExpState.totaltests % ExpState.migrations % stats.gen_count % stats.st_avg_numparts % stats.st_avg_fit % stats.st_max_fit % (Math.time-t0) % ExpState.migration_time % ExpParams.threads % ExpParams.capacity);
    2529                Simulator.print(GenePools[0].best().genotype);
    2630        }
    27         Simulator.stop();
    2831}
    2932~
Note: See TracChangeset for help on using the changeset viewer.