Changeset 462
- Timestamp:
- 02/03/16 23:12:23 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
experiments/frams/multi-threading/data/scripts/test-mt.script
r116 r462 3 3 help:Multithreading efficiency test 4 4 code:~ 5 function main (complexify_geno,timeinterval,intervals)5 function main_args(complexify_geno,timeinterval,intervals) 6 6 { 7 7 // ExpParams.mix_period (percentage of the gene pool capacity) is kept at the default value (1000%) … … 17 17 //Simulator.print(GenePools[0][0].genotype); //ensure that the initialgen is in the gene pool - init() does this 18 18 19 var t0=Math.time; 20 var next_pause; 19 21 Simulator.start(); 20 22 for(var iter=0;iter<intervals;iter++) 21 23 { 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); 25 29 Simulator.print(GenePools[0].best().genotype); 26 30 } 27 Simulator.stop();28 31 } 29 32 ~
Note: See TracChangeset
for help on using the changeset viewer.