How do i get something included in offical script includes? 

I noticed a slight bug where if the genepool consists of nothing but one
genotype, it throw the program into an infinate loop. So to work around that
i made some additions to standard_props.inc and standard_select.inc.
So it will be easier on me to keepup with updates, I'd like to submit it for
including to offical includes. Also think others would find use for it,
other then just a work around for a bug.

What it does is the option Unique Genomes is checked in the Parameters pane
of the Experment paramters (or uniq_genotype is set to 1 in the experiment
def file) it will delete copies of genomes before removing anything else.
For those interested in using this now here is the code snipets:

standard_select.inc:

function selectedForDeletion()
{
//Remove copies from pool first;
if (ExpProperties.uniq_genotypes) {
var i=0;
while(i < GenotypeGroup.count) {
var gen = GenotypeGroup.getGenotype(i);
if (gen.popsiz > 1)
return i;
i=i+1;
}
}

if (ExpProperties.delrule == 0)
return GenotypeLibrary.random();
if (ExpProperties.delrule == 1)
return GenotypeLibrary.revroulette();
return GenotypeLibrary.worst();
}

and in standard_props.inc:

property:
id:uniq_genotypes
name:Unique Genomes
type:d 0 1

Forums: