BUG:GPF in v 2.10 

The windows version of framsticks 2.10 gui gives me the following error in a
popwindow within 1million steps usually within 50k steps

Access violation at address 0040231D in modules Framsticks.exe. Read of
address 00000110

I have a zip file everything i've changed thats different from default, the
experiment states and a messages file which yields no new info, and
everything new i added for this experiment to work. Its not my thrust
neuron, as i've had a few billion steps with no problems with this version
of the nueron.

I have recently changed onKill, onBorn, onFoodCollision in the experiment
defeination.. and made user2 the heaviest weight in fitness.

Where should i send the zipfile?

Forums: 

I found what it was, I can work around it but this should throw an expection
in future versions.

This see if i can explain this

in the onKill function, i was trying to add an energy consumed uservar to
the genotypes, and since i was playing with many instances i wanted to be
sure that it took the average across all instances. So i placed it after
updatePerformanceWithPopSize(); as that creates a new genotype lib if there
was no new one. this is the code placed after the
updatePerformanceWithPopSize();

//Eating
if (Genotype.popsiz > 1) {
Genotype.user2 =
(Genotype.user2*(Genotype.popsiz -1)+Creature.user2)/Genotype.popsiz;
} else {
Genotype.user2 = 0.0 + Creature.user2;
}

i just moved that to before the update function and it doesn't throw that
GPF

Maciej Komosinski's picture

> I found what it was, I can work around it but this should throw an expection
> in future versions.
> in the onKill function, i was trying to add an energy consumed uservar to
> the genotypes, and since i was playing with many instances i wanted to be...
> i just moved that to before the update function and it doesn't throw that
> GPF

The proper place and usage is like this (a sample of user1 averaging):

function updatePerformanceWithPopSize()
{
GenotypeLibrary.genotype = GenotypeLibrary.findGenotypeForCreature();
if (GenotypeLibrary.genotype < 0) // not found in gene pool
{
GenotypeLibrary.getFromCreature();
Genotype.num = 0; // 0 = it will be filled automatically
GenotypeLibrary.copyGenotype(0);
Genotype.popsiz = 0;
}
Genotype.user1 = ((Genotype.user1 * Genotype.popsiz) +
Creature.user1) / (Genotype.popsiz + 1.0);
GenotypeLibrary.addPerformanceFromCreature();
}