Skip to content

Commit

Permalink
sync with minimal.slim with git diff
Browse files Browse the repository at this point in the history
  • Loading branch information
jiseonmin committed Mar 15, 2024
1 parent 35a28b5 commit b518b61
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions selection/spatial_selection.slim
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ initialize() {

defaults = Dictionary(
"SEED", getSeed(),
"SD", 0.3, // sigma_D, dispersal distance
"SX", 0.3, // sigma_X, interaction distance for measuring local density
"SM", 0.3, // sigma_M, mate choice distance
"K", 5, // carrying capacity per unit area
"LIFETIME", 4, // average life span
"WIDTH", 25.0, // width of the simulated area
"HEIGHT", 25.0, // height of the simulated area
"RUNTIME", 2000, // total number of ticks to run the simulation for
"L", 1e8, // genome length
"R", 1e-8, // recombination rate
"MU", 0, // mutation rate
"SD", 0.3, // sigma_D, dispersal distance
"SX", 0.3, // sigma_X, interaction distance for measuring local density
"SM", 0.3, // sigma_M, mate choice distance
"K", 5, // carrying capacity per unit area
"LIFETIME", 4, // average life span
"WIDTH", 25.0, // width of the simulated area
"HEIGHT", 25.0, // height of the simulated area
"RUNTIME", 200, // total number of ticks to run the simulation for
"L", 1e8, // genome length
"R", 1e-8, // recombination rate
"MU", 0 // mutation rate
"S_FEC", 0., // selection coefficient for fecundity-based selection
"S_MOR", 0.5, // selection coefficient for mortality-based selection
"H_FEC", 0.5, // dominance coefficient for fecundity-based selection
Expand All @@ -30,7 +30,7 @@ initialize() {
// Set up parameters with a user-defined function
setupParams(defaults);

// Set up constants that depend on externally defined parameters
// Set up constants that depend on externally defined parameters
defineConstant("FECUN", 1 / LIFETIME);
defineConstant("RHO", FECUN / ((1 + FECUN) * K));
defineGlobal("PARAMS", defaults);
Expand Down Expand Up @@ -83,7 +83,7 @@ first() {
i2.evaluate(p1);
}

reproduction(){
reproduction() {
// individual fitness based on mutation count
mutcount = sum(individual.genomes.countOfMutationsOfType(m1));
indiv_s = S_FEC * (H_FEC * asFloat(mutcount==1) + asFloat(mutcount==2));
Expand Down Expand Up @@ -172,7 +172,7 @@ function (void)setupParams(object<Dictionary>$ defaults)
if (!exists("OUTDIR")) defineConstant("OUTDIR", ".");
defaults.addKeysAndValuesFrom(Dictionary("PARAMFILE", PARAMFILE, "OUTDIR", OUTDIR));

if (fileExists(PARAMFILE)){
if (fileExists(PARAMFILE)) {
local_defaults = Dictionary(paste(readFile(PARAMFILE)));
defaults.addKeysAndValuesFrom(local_defaults);
defaults.setValue("read_from_paramfile", PARAMFILE);
Expand All @@ -192,4 +192,4 @@ function (void)setupParams(object<Dictionary>$ defaults)
catn("===========================");
catn("Model constants: " + defaults.serialize());
catn("===========================");
}
}

0 comments on commit b518b61

Please sign in to comment.