You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the new update, I have found that my conditional simulation that includes tree sequence recording returns an error when it restarts if the condition could not be met. The error is "(Species::InstantiateSLiMObjectsFromTables): (internal error) remembered_genomes is not empty" and it invalidates the simulation. I think I need to clear the individuals from the memory when the simulation restarts, but I'm not sure how to do that.
I have adapted recipe 9.2 such that it returns the same error (see minimal example below).
Thanks so much for your help!
Olivia
// Minimal example: Conditional simulation with tree sequence recording
initialize() {
initializeMutationRate(0);
initializeMutationType("m1", 0.0, "f", 0.0);// introduced mutation
initializeGenomicElementType("g1", m1, 1.0);
initializeGenomicElement(g1, 0, 99999);
initializeRecombinationRate(1e-8);
initializeTreeSeq();
}
1 early() {
// save this run's identifier, used to save and restore
defineConstant("simID", getSeed());
sim.addSubpop("p1", 500);
}
1000 late() {
// save the state of the simulation
sim.treeSeqOutput(tempdir() + "slim_" + simID + ".trees");
// introduce the sweep mutation
target = sample(p1.genomes, 1);
target.addNewDrawnMutation(m1, 10000);
}
1000:100000 late() {
rInd= sample(p1.individuals, 10);
sim.treeSeqRememberIndividuals(rInd);
if (sim.countOfMutationsOfType(m1) == 0)
{
fixed = (sum(sim.substitutions.mutationType == m1) == 1);
if (fixed){
cat(simID + ": FIXED\n");
sim.simulationFinished();
}
else
{
cat(simID + ": LOST at " +sim.cycle+" - RESTARTING\n");
// go back to tick 1000
sim.readFromPopulationFile(tempdir() + "slim_" + simID + ".trees");
// start a newly seeded run
setSeed(rdunif(1, 0, asInteger(2^62) - 1));
// re-introduce the sweep mutation
target = sample(p1.genomes, 1);
target.addNewDrawnMutation(m1, 10000);
}
}
}
The text was updated successfully, but these errors were encountered:
Hi @olivia-johnson. Thanks very much for the bug report. I'll look into it as soon as I can, perhaps later today. I think it will be an easy fix; it's just a case that we haven't tested, and so it slipped through the cracks. (@petrelharp perhaps it would be good for you and I to both add a test that hits this case, in our respective testing suites!)
Hi everyone,
Following the new update, I have found that my conditional simulation that includes tree sequence recording returns an error when it restarts if the condition could not be met. The error is "(Species::InstantiateSLiMObjectsFromTables): (internal error) remembered_genomes is not empty" and it invalidates the simulation. I think I need to clear the individuals from the memory when the simulation restarts, but I'm not sure how to do that.
I have adapted recipe 9.2 such that it returns the same error (see minimal example below).
Thanks so much for your help!
Olivia
The text was updated successfully, but these errors were encountered: