Skip to content

Commit

Permalink
sync changes to to minimal.slim using git diff
Browse files Browse the repository at this point in the history
  • Loading branch information
jiseonmin committed Mar 15, 2024
1 parent 40580d0 commit 746ff7f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions adult_movement/adult_movement.slim
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ early() {
pos = p1.pointDeviated(offspring.size(), pos, "reprising", INF, "n", SD);
offspring.setSpatialPosition(pos);

// Measure local density and use it for density regulation
// Measure local density and use it for density regulation
i1.evaluate(p1);
inds = p1.individuals;
competition = i1.localPopulationDensity(inds);
inds.fitnessScaling = 1 / (1 + RHO * competition);
}

late() {
if ((p1.individualCount == 0)){
if ((p1.individualCount == 0)) {
catn("Population went extinct! Ending the simulation.");
sim.simulationFinished();
}
Expand Down
3 changes: 2 additions & 1 deletion maps/simple_map.slim
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ s1 late() {
// printing out information at selected ticks
for(i in seq(0, len(pixial))) {
catn(pixial[i]);
//writing info about density

// writing info about density
mytextfileinfo = c(mytextfileinfo, paste0(sim.cycle + "," + ind_den[i] + "," + pixial[i]));
}
writeFile(mytextfile, mytextfileinfo, append=T);
Expand Down
10 changes: 6 additions & 4 deletions mate_choice/mate_choice.slim
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,16 @@ initialize() {
}

first() {
i2.evaluate(p1); // evaluate mate choice interaction values
// preparation for the reproduction() callback
i2.evaluate(p1);
}

reproduction(NULL, "F") { // females choose a male mate
// females choose a male mate
reproduction(NULL, "F") {
mate = i2.drawByStrength(individual, 1);
if (mate.size())
if (mate.size())
// fecundity is doubled because only females reproduce
offspring = subpop.addCrossed(individual, mate, count = rpois(1, 2 * FECUN));
subpop.addCrossed(individual, mate, count = rpois(1, 2 * FECUN));
}

early() {
Expand Down

0 comments on commit 746ff7f

Please sign in to comment.