######################################## ######################################## # force the generation of the next population ######################################## set save_cwd = `execute("oppwf")` # note where we were opcf /ch/evolve # work mostly from evolve CHOP net source copy_params.cmd # fill static params with live values # note who was selected and stick it in "selected" CHOP # also put num selected in parm for eventual usage by "elitism" chop set sel = `opselect("/obj")` opparm selected delscope ( "$sel" ) opparm params value8 ( `argc($sel)` ) #increment current generation number setenv gen = `chop("params/generation")` # current generation setenv gen = `$gen+1` opparm params value6 ( $gen ) source change_pop_size.cmd # modify pop size if required # load previous generation's genes into top of CHOP network opcook -f 1 `chop("params/num_genes")` load_genes opset -b on load_genes ; opset -b off load_genes opparm switch1 index ( 1 ) # switch chop must allow processed genes to pass # hack: change a chop value, so sops watching this will recook opparm params value10 ( $gen ) # value10 == recook source unselect_all.cmd # guess what this does! # save current generation's genes into a file opsave -f 1 `chop("params/num_genes")` genotypes Genes/genes.clip opcf $save_cwd # back to where we were before we got here # HOW CAN I HOME THE PERSP1 VIEWPORT HERE, if popsize has changed? # alternatively, could figure out how to scale up/down all objects to fit # in viewport? ######################################## ########################################