Changeset 250 for experiments/frams/evolve-speed-vs-gravity
- Timestamp:
- 11/08/14 16:56:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
experiments/frams/evolve-speed-vs-gravity/data/scripts/evolve-speed-vs-gravity.script
r184 r250 9 9 Populations[0].perfperiod=100000; //fitness: velocity serves as distance (because sampling period is longer than lifespan) 10 10 ExpParams.initialgen="XX[|,1:1][N,1:1,2:1][T][G]"; 11 11 GenePools[0].fitness="""function penalty(count) 12 { 13 var toomany=count-50; 14 if (toomany<=0) return 0; else return -toomany*0.001; 15 } 16 return this.velocity+penalty(this.numparts)+penalty(this.numjoints)+penalty(this.numneurons)+penalty(this.numconnections);"""; 17 12 18 Simulator.init(); 13 19 //Simulator.print(GenePools[0][0].genotype); //ensure the initialgen is in the gene pool … … 34 40 Simulator.stop(); 35 41 Simulator.print("%g (x%g) %s" % best.fit % best.popsiz % best.genotype); 42 43 GenePools[0].clear(); //remove all... 44 best.moveTo(GenePools[0]); //...then restore best... 45 Simulator.save("best_%g_%u.expt" % gravity % (0+Math.time)); //...and save it in a file just in case we want to see all of its data 36 46 } 37 47 ~
Note: See TracChangeset
for help on using the changeset viewer.