Skip to content

Commit f8ef49f

Browse files
committed
tweak recipe 9.5.3 to use dynamic scheduling
1 parent d7471de commit f8ef49f

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

QtSLiM/recipes/Recipe 9.5.3 - A soft sweep with a random de novo mutation schedule.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,9 @@ initialize() {
1414
gens = cumSum(rpois(10, 10)); // make a vector of start gens
1515
gens = gens + (1000 - min(gens)); // align to start at 1000
1616
defineConstant("Z", max(gens)); // remember the last gen
17-
18-
for (gen in gens)
19-
community.registerLateEvent(NULL, s1.source, gen, gen);
20-
21-
community.deregisterScriptBlock(s1);
17+
defineConstant("ADD_GENS", gens); // schedule the add events
2218
}
23-
s1 1000 late() {
19+
ADD_GENS late() {
2420
target = sample(p1.haplosomes, 1);
2521
mut = sim.mutationsOfType(m2);
2622
if (mut.size() > 0)

SLiMgui/Recipes/Recipe 9.5.3 - A soft sweep with a random de novo mutation schedule.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,9 @@ initialize() {
1414
gens = cumSum(rpois(10, 10)); // make a vector of start gens
1515
gens = gens + (1000 - min(gens)); // align to start at 1000
1616
defineConstant("Z", max(gens)); // remember the last gen
17-
18-
for (gen in gens)
19-
community.registerLateEvent(NULL, s1.source, gen, gen);
20-
21-
community.deregisterScriptBlock(s1);
17+
defineConstant("ADD_GENS", gens); // schedule the add events
2218
}
23-
s1 1000 late() {
19+
ADD_GENS late() {
2420
target = sample(p1.haplosomes, 1);
2521
mut = sim.mutationsOfType(m2);
2622
if (mut.size() > 0)

0 commit comments

Comments
 (0)