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
Copy file name to clipboardExpand all lines: AgModel.py
+17-15Lines changed: 17 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,9 @@
12
12
# Introduce SeedToYieldRatio, and use it to replace the variables for initial and maximum Kernel yields per patch to be initial and maximum SeedToYieldRatio
13
13
# Tie the SelectionCoefficient to also increase the SeedToYieldRatio over time.
14
14
# Add a WildSeedingRate and CultivationSeedingRate (number of kernels/ha) and remove CerealCultivationDensity
15
+
# Allow for surplus and storage
16
+
# Allow birth rate and death rate to be positively affected by surplus
17
+
# Increase diversity of alternative food resources (more than just one prey or plant resource)
15
18
16
19
# v0.5 to v0.6
17
20
# Removed HunterGathererRatio (allows this to be an emergent property)
self.People=50## Enter the initial number of people in the band
53
-
self.MaximumPeople=200## Enter the maximum human population (just to keep this in the realm of possibility, and to help set the y axis on the plot)
54
-
self.HumanBirthRate=0.035## Enter the annual human per capita birth rate
56
+
self.MaximumPeople=3000## Enter the maximum human population (just to keep this in the realm of possibility, and to help set the y axis on the plot)
57
+
self.HumanBirthRate=0.032## Enter the annual human per capita birth rate
55
58
self.HumanDeathRate=0.03## Enter the annual human per capita death rate
56
59
self.HumanBirthDeathFilter=0.005## Width of the Gaussian randomizing filter for human birth and death rates
57
60
self.StarvationThreshold=0.8## Enter the starvation threshold (percentage of the total kcal below which people are starving, and effective reproduction goes to 0)
self.ForagingUncertainty=0.1## Width of the Gaussian randomizing filter that is applied to foraging payoff numbers in the forager's Diet Breadth decision algorithm
63
66
# PREY VARIABLES
64
-
self.Prey=1000## Enter the inital number of Prey in the hunting region
65
-
self.MaxPrey=3000## Enter the maximum number of Prey that the region can sustain (carrying capacity) without human predation
66
-
self.MaxPreyMigrants=100## Enter the maximum number of new Prey that migrate into the territory each year (keeps Prey pop from being totally wiped out)
67
-
self.PreyBirthRate=0.06## Enter the annual per capit birth rate for Prey
68
-
self.PreyDeathRate=0.03## Enter the annual per capita natural death rate for Prey
67
+
self.Prey=200## Enter the initial number of Prey in the hunting region
68
+
self.MaxPrey=500## Enter the maximum number of Prey that the region can sustain (carrying capacity) without human predation
69
+
self.MaxPreyMigrants=0## Enter the maximum number of new Prey that migrate into the territory each year (keeps Prey pop from being totally wiped out)
70
+
self.PreyBirthRate=0.06## Enter the annual per capita birth rate for Prey
71
+
self.PreyDeathRate=0.04## Enter the annual per capita natural death rate for Prey
69
72
self.PreyBirthDeathFilter=0.005## Width of the Gaussian randomizing filter for prey birth and death rates
70
-
self.PreyReturns=150000.0## Enter the return rate (number of kcals) per Prey killed
73
+
self.PreyReturns=200000.0## Enter the return rate (number of kcals) per Prey killed
71
74
self.PreySearchCost=72.0## Enter the density dependent search costs for Prey (hours time expended per recovery of one Prey at the density "PreyDensity")
72
75
self.PreyDensity=1000## Density of Prey for which search cost prey search costs are known
73
-
self.MaxPreyEncountered=10.0## Maximum number of individual Prey encountered per discovery
76
+
self.MaxPreyEncountered=4.0## Maximum number of individual Prey encountered per discovery
74
77
self.MinPreyEncountered=1.0## Minimum number of individual Prey encountered per discovery
75
78
self.PreyHandlingCost=16.0## Enter the handling costs for Prey (hours handling time expended once encountered)
76
79
# CEREAL VARIABLES
77
-
self.Cereal=200## Enter the number of Cereal patches in the gathering region (assume a patch is ~1ha)
80
+
self.Cereal=100## Enter the number of Cereal patches in the gathering region (assume a patch is ~1ha)
78
81
self.WildCerealReturns=0.05## Enter the return rate (number of kcals) per wild-type Cereal seed
79
82
self.DomesticatedCerealReturns=0.1## Enter the return rate (number of kcals) per domestic-type Cereal seed
80
83
self.WildToDomesticatedProportion=0.98## Enter the starting proportion of wild-type to domestic-type Cereal (1.0 = all wild, 0.0 = all domestic)
81
-
self.CerealSelectionRate=0.03## Enter the coefficient of slection (e.g., the rate of change from wild-type to domestic type)
82
-
self.CerealDiffusionRate=0.02## Enter the coefficient of diffusion for Cereal (the rate at which selected domestic traits dissappear due to crossbreeding)
84
+
self.CerealSelectionRate=0.03## Enter the coefficient of selection (e.g., the rate of change from wild-type to domestic type)
85
+
self.CerealDiffusionRate=0.02## Enter the coefficient of diffusion for Cereal (the rate at which selected domestic traits disappear due to crossbreeding)
83
86
self.SelectionDiffusionFilter=0.001## Enter the width of the Gaussian filter applied to selection and diffusion rates.
84
87
self.CerealSearchCosts=1.0## Enter the search costs for Cereal (hours expended to find one patch of Cereal)
85
88
self.CerealDensity=10000000## Number of Cereal kernels that are harvested per patch at the start of the simulation
@@ -386,8 +389,8 @@ def deathdealer(p, f, n):
386
389
ifRealTimeText: print("ate everything!!!")
387
390
break
388
391
#first calculate info about the current state of Cereal
389
-
WildToDomesticatedProportion_now=np.mean(Cereal_df.WildToDomesticatedProportion[0:Cereal_now]) #Note that we are taking the mean proportion acoss all remaining Cereal patches in the data array.
390
-
CerealDensity_now=np.mean(Cereal_df.CerealDensity[0:Cereal_now]) #Note that we are taking the mean number of individuals perpatch across all remaining patches in the Cereal data array. Note that we are reading off of the right end of the array list.
392
+
WildToDomesticatedProportion_now=np.mean(Cereal_df.WildToDomesticatedProportion[0:Cereal_now]) #Note that we are taking the mean proportion across all remaining Cereal patches in the data array.
393
+
CerealDensity_now=np.mean(Cereal_df.CerealDensity[0:Cereal_now]) #Note that we are taking the mean number of individuals per patch across all remaining patches in the Cereal data array. Note that we are reading off of the right end of the array list.
391
394
CerealReturns= (WildCerealReturns*WildToDomesticatedProportion_now) + (DomesticatedCerealReturns* (1-WildToDomesticatedProportion_now)) #determine the actual kcal return for Cereal, based on the proportion of wild to domesticated.
392
395
CombinedCerealHandlingCost= (WildCerealHandlingCost*WildToDomesticatedProportion_now) + (DomesticatedCerealHandlingCost* (1-WildToDomesticatedProportion_now)) #determine the actual handling time for Cereal, based on the proportion of wild to domesticated.
393
396
ifPrey_now<=0:
@@ -403,7 +406,6 @@ def deathdealer(p, f, n):
403
406
Cerealscore=0
404
407
else:
405
408
Cerealscore= (CerealReturns*CerealDensity_now ) / (CerealSearchCosts+ (CombinedCerealHandlingCost*CerealDensity_now)) #find the current return rate (kcal/hr for Cereal.
ifnp.random.normal(Preyscore, Preyscore*ForagingUncertainty) >np.random.normal(Cerealscore, Cerealscore*ForagingUncertainty): # Hunting prey is more profitable
408
410
iftimebudget<=0:
409
411
ifRealTimeText: print("Ran out of labor time this year")
0 commit comments