source: experiments/frams/multi-threading/data/scripts/test-mt.script @ 755

Last change on this file since 755 was 480, checked in by sz, 9 years ago

experiment scripts updated to match the upcoming Framsticks version (ExpParams? ==> ExpProperties?, Fields ==> NeuroProperties?, prop: ==> property)

File size: 1.5 KB
Line 
1script:
2name:Multithreading efficiency test
3help:Multithreading efficiency test
4code:~
5function main_args(complexify_geno,timeinterval,intervals)
6{
7        // ExpProperties.mix_period (percentage of the gene pool capacity) is kept at the default value (1000%)
8
9        Math.randomize();
10        //Simulator.expdef="standard-mt"; //set multithreaded experiment; this is done by the shell script
11       
12        ExpProperties.initialgen="XX[|,1:1][N,1:1,2:1][T][G]";
13        for(var i=0;i<complexify_geno;i++) //make a big genotype by doubling the simple one above. Note: exponential!
14                ExpProperties.initialgen=ExpProperties.initialgen+ExpProperties.initialgen;
15       
16        Simulator.init();
17        //Simulator.print(GenePools[0][0].genotype); //ensure that the initialgen is in the gene pool - init() does this
18               
19        var t0=Math.time;
20        var next_pause;
21        Simulator.start();
22        for(var iter=0;iter<intervals;iter++)
23        {
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 % ExpProperties.threads % ExpProperties.capacity);
29                Simulator.print(GenePools[0].best().genotype);
30        }
31}
32~
33
Note: See TracBrowser for help on using the repository browser.