diff --git a/model/FDM.nlogo b/model/FDM.nlogo
index ef23596..b0e0eea 100644
--- a/model/FDM.nlogo
+++ b/model/FDM.nlogo
@@ -139,7 +139,7 @@ to setup
set no-output temp-no-output
- set model-version "V1.5.0"
+ set model-version "V1.6.0"
if behaviorspace-run-number > 0 [ random-seed behaviorspace-run-number ]
@@ -238,9 +238,14 @@ to go
; gene-drive: on/off switch
if gene-drive [
- if ticks = release-day * ticks-per-day [
+ if ticks = ( release-day - 1 ) * ticks-per-day + 1 [
release-gene-drive
]
+ if periodic-release > 1 and ticks > ( release-day - 1 ) * ticks-per-day + 1 and ticks <= ( ( (periodic-release - 1) * periodic-interval ) + ( release-day - 1 ) ) * ticks-per-day + 1 [
+ if ( ticks - ( ( release-day - 1 ) * ticks-per-day + 1 ) ) mod ( periodic-interval * ticks-per-day ) = 0 [
+ release-gene-drive
+ ]
+ ]
]
; if off-season => freeze
@@ -440,7 +445,7 @@ init-pop
init-pop
0
10000
-2.0
+0.0
1
1
NIL
@@ -649,7 +654,7 @@ HORIZONTAL
PLOT
922
-291
+324
1308
510
flies
@@ -687,7 +692,7 @@ PENS
PLOT
1310
-292
+324
1654
511
genotypes
@@ -872,10 +877,10 @@ NIL
HORIZONTAL
SLIDER
-925
-251
-1097
-284
+926
+287
+1098
+320
fitness-PP
fitness-PP
0
@@ -887,10 +892,10 @@ NIL
HORIZONTAL
SLIDER
-1103
-251
-1275
-284
+1104
+287
+1276
+320
fitness-RR
fitness-RR
0
@@ -902,10 +907,10 @@ NIL
HORIZONTAL
SLIDER
-1279
-253
-1451
-286
+1280
+289
+1452
+322
fitness-MM
fitness-MM
0
@@ -982,6 +987,46 @@ count flies with [ mode = \"stationary\" ]
1
11
+SLIDER
+926
+245
+1098
+278
+periodic-release
+periodic-release
+1
+100
+10.0
+1
+1
+NIL
+HORIZONTAL
+
+SLIDER
+1102
+247
+1274
+280
+periodic-interval
+periodic-interval
+1
+100
+7.0
+1
+1
+NIL
+HORIZONTAL
+
+CHOOSER
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ setup
+ go
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ setup
+ go
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ setup
+ go
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@#$#@#$#@
@#$#@#$#@
diff --git a/model/flies.nls b/model/flies.nls
index 8b800c1..260b456 100644
--- a/model/flies.nls
+++ b/model/flies.nls
@@ -771,8 +771,85 @@ end
to release-gene-drive
- ask patch ( max-pxcor / 2 ) ( max-pycor / 2 ) [
- sprout-flies release-amount [
+ let gd-release-amount release-amount
+ let gd-xcor 0
+ let gd-ycor 0
+
+ if periodic-release > 1 [
+ set gd-release-amount ceiling ( release-amount / periodic-release )
+ ]
+
+ if release-location = "center" [
+
+ set gd-xcor ( max-pxcor / 2 )
+ set gd-ycor ( max-pycor / 2 )
+ release-gene-drive-at-position gd-xcor gd-ycor gd-release-amount
+
+ ]
+ if release-location = "corner-trees" [
+
+ set gd-release-amount ceiling ( gd-release-amount / 4 )
+
+ ; corner tree bottom left
+ set gd-xcor ( border-margin + wildberry-plant-width + wildberry-plant-margin )
+ set gd-ycor ( border-margin + wildberry-plant-width + wildberry-plant-margin )
+ release-gene-drive-at-position gd-xcor gd-ycor gd-release-amount
+
+ ; corner tree bottom right
+ set gd-xcor ( border-margin + wildberry-plant-width + wildberry-plant-margin + ( ( trees-per-row - 1 ) * ( tree-width + tree-margin-x ) ) + tree-width )
+ set gd-ycor ( border-margin + wildberry-plant-width + wildberry-plant-margin )
+ release-gene-drive-at-position gd-xcor gd-ycor gd-release-amount
+
+ ; corner tree top left
+ set gd-xcor ( border-margin + wildberry-plant-width + wildberry-plant-margin )
+ set gd-ycor ( border-margin + wildberry-plant-width + wildberry-plant-margin + ( ( tree-rows - 1 ) * ( tree-width + tree-margin-y ) ) + tree-width )
+ release-gene-drive-at-position gd-xcor gd-ycor gd-release-amount
+
+ ; corner tree top right
+ set gd-xcor ( border-margin + wildberry-plant-width + wildberry-plant-margin + ( ( trees-per-row - 1 ) * ( tree-width + tree-margin-x ) ) + tree-width )
+ set gd-ycor ( border-margin + wildberry-plant-width + wildberry-plant-margin + ( ( tree-rows - 1 ) * ( tree-width + tree-margin-y ) ) + tree-width )
+ release-gene-drive-at-position gd-xcor gd-ycor gd-release-amount
+
+ ]
+ if release-location = "wildberry-plants" [
+
+ ; release gene drives every tenth wildberry plant
+
+ ; calculate the release amount for every release location
+ set gd-release-amount ceiling ( gd-release-amount / ( ( floor ( ( max-pxcor - ( border-margin * 2 ) ) / 10 ) ) * 2 + ( floor ( ( max-pycor - ( border-margin * 2 ) ) / 10 ) ) * 2 ) )
+
+ ; release at all horizontal locations
+ set gd-xcor ( border-margin + 1 )
+ while [ gd-xcor <= ( max-pxcor - border-margin ) ] [
+ if ( gd-xcor - border-margin ) mod 10 = 0 [
+ set gd-ycor ( border-margin + 1 )
+ release-gene-drive-at-position gd-xcor gd-ycor gd-release-amount
+ set gd-ycor ( max-pycor - border-margin )
+ release-gene-drive-at-position gd-xcor gd-ycor gd-release-amount
+ ]
+ set gd-xcor ( gd-xcor + 1 )
+ ]
+
+ ; release at all vertical locations
+ set gd-ycor ( border-margin + 1 )
+ while [ gd-ycor <= ( max-pycor - border-margin ) ] [
+ if ( gd-ycor - border-margin ) mod 10 = 0 [
+ set gd-xcor ( border-margin + 1 )
+ release-gene-drive-at-position gd-xcor gd-ycor gd-release-amount
+ set gd-xcor ( max-pxcor - border-margin )
+ release-gene-drive-at-position gd-xcor gd-ycor gd-release-amount
+ ]
+ set gd-ycor ( gd-ycor + 1 )
+ ]
+
+ ]
+
+end
+
+to release-gene-drive-at-position [gd-xcor gd-ycor gd-release-amount]
+
+ ask patch gd-xcor gd-ycor [
+ sprout-flies gd-release-amount [
set mode "adult"
set mode-duration 0
set generation 1
@@ -797,7 +874,7 @@ to release-gene-drive
if sex = "f" [ set color magenta ]
if sex = "m" [ set color blue ]
]
- ]
+ ]
end