SlideShare a Scribd company logo
1 of 1
Download to read offline
Modeling Animal Time Resource Allocation Using Python
Cesar Chavez & Davi Mondragon
New Mexico Alliance for Minority Participation
Home Institution: Clovis Community College; Luna Community College
Department of Mathematics, Eastern New Mexico University
Dr. Brian Pasko
Conclusions
After running the simulation 10,000 times and varied the digestion we found that the animal stayed mostly
in the state [1,0] and [2,0] when the digestion rate was small. As the digestion rate increased it skewed
more towards the [0,1], [1,0] and [2,0] states. The animal spent most of its time resting when the digestion
rate was small and as the digestion rate increased so did the number of times it feed. The opposite can be
said when the hunt success rate was varied. The animal spent most of its time in the feed state and as hunt
success increased the animal spent most if its time resting. Finally, we varied digestion and hunt success at
the same time. When hunt success was 0.1 and digestion was 1.0; the animal spent most of its time resting
just as when only digestion was varied. Again the opposite can be said about the hunt success rate when it
was 1.0 and digestion was 0.1. The most outstanding result was when the digestion rate and hunt success
was the same; the state of the animal seemed to be well balanced. The animal arrived at each stage 25% of
the time. It was not skewed to the left or to the right, but was evenly distributed throughout each stage of
hunt success or digestion.
Objectives
In this project we developed a working model using Python that represents time
resource allocation for different animals. Once we have this model, we varied the
variables gut level and digestion one at a time in order to see the impact these
changes have on each other in the model. Once this is completed we want to add
another factor which is prey size to see what we can derive from the resulted data.
After obtaining these values we want to vary digestion and hunt success
simultaneously to see the outcome. Lastly, we used Python to count the amount of
times the animal was in each state for each set of outcomes to analyze.
Implications
The implication of this project is that Python can be used to model an infinite number of
systems and different models for a variety of professional fields. It is predominantly used in
mathematical fields, because it is excellent at calculating functions and modeling mathematical
data. Python can also be used to develop or test any system that has expressible limits. The
model in this project provides an insight to the behavior of animals and how factors like hunt
successfully, gut level, and meal size affect the longevity of the animal. This project is an
adequate example of how Python can be applied to a real life scenario such as animal feeding
patterns to understand and learn from the models it generates.
Materials & Methods:
For this research project we used a computer with the Python software. To begin this project we had to
learn the basic commands of the computer science language Python. Then, we started to write the
computer code where we started with constants to ensure that only one variable was being tested at a
time. For instance, only digestion would vary for the first trail and then hunt success would vary for
the other trial. “h” is the current hunger level, “a” is the activity (resting, 0 or feeding, 1), “b” is the
hunt success, “d” is the digestion rate, “u” the lower hunger set point where it began to feed, and “s”
the upper hunger set point where it stopped feeding. The state where the animal began was at the stage
[2, 0] where the number 2 is the current hunger and 0 is the activity. After a random number was
generated to test if the animal would rest or feed which affected the activity and hunger stage of the
animal. The simulation will run 10,000 times for the same animal, and keep its state whether it decided
to feed or rest depending on the random number generated.
Part of the code
h = [2]
a = [0]
state = [[2, 0]]
b = 1/2
#d = 1/3
u = 0
s = 2
for j in range(3):
d=0+0.1*j
for i in range(1, 10000):
dieroll = random.random()
if a[i - 1] == 0:
if dieroll < d:
h.append(h[i -1] - 1)
else:
h.append(h[i - 1])
if h[i] <= u:
a.append(1)
else:
a.append(0)
if a[i - 1] == 1:
if dieroll < b:
h.append(h[i - 1] + 1)
else:
h.append(h[i - 1])
if h[i] >= s:
a.append(0)
else:
a.append(1)
for i in range(len(a)):
state.append([h[i],a[i]])
#print(state)
num1 = 0
num2 = 0
num3 = 0
num4 = 0
num5 = 0
num6 = 0
num7 = 0
num8 = 0
num9 = 0
for i in range(len(state)):
if state[i] == [0, 1]:
num1 = num1 + 1
elif state[i] == [1, 0]:
num2 = num2 +1
elif state[i] == [1, 1]:
num3 = num3 + 1
elif state[i] == [2, 1]:
num4 = num4 + 1
elif state[i] == [3, 1]:
num5 = num5 + 1
elif state[i] == [4, 0]:
num6 = num6 + 1
elif state[i] == [2, 0]:
num7 = num7 + 1
else:
num8 = num8 + 1
print ('[0, 1]', (num1))
print ('[1, 0]', (num2))
print ('[1, 1]', (num3))
print ('[2, 1]', (num4))
print ('[3, 1]', (num5))
print ('[4, 0]', (num6))
print ('[2, 0]', (num7))
print ('[3, 0]', (num8))
Abstract
This project provides insight into time resource allocation in animals using the computer pro-
gram Python. In this project Python is used to test and illustrate a model of an animal’s life cy-
cle. The model provides a detailed representation of an animal’s behavior based on the required
activities of feeding and resting. The independent variables are the rate of digestion (decreasing
gut level) and hunt success (increasing gut level). They were varied simultaneously and concur-
rently. During the experiment the state of the animal’s activity is tracked, feeding or resting. At
each iteration, the gut level is changed randomly based on the current activity and the subse-
quent activity is changed based on the new gut level. This computer model allows us to approx-
imate an animal’s life cycle constructed on the variables of hunger and need for rest.
State 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
0.1
[0, 1] 2214 1730 1304 954 849 673 618 572 520 437
[1, 0] 2614 3289 3500 4023 4039 4498 4467 4446 4545 4854
[1, 1] 2734 1748 1265 965 870 664 656 608 504 437
[2, 0] 2439 3234 3932 4059 4243 4166 4260 4375 4432 4273
0.2
[0, 1] 3467 2448 2067 1645 1387 1248 1100 1001 920 832
[1, 0] 1647 2425 3053 3297 3605 3755 3925 4048 4150 4022
[1, 1] 3187 2569 1950 1713 1449 1269 1115 951 905 832
[2, 0] 1700 2559 2931 3346 3560 3729 3861 4001 4026 4315
0.3
[0, 1] 3828 2877 2593 2192 1913 1615 1538 1350 1244 1141
[1, 0] 1305 1961 2537 2808 3088 3382 3506 3678 3768 3995
[1, 1] 3632 3094 2460 2260 1911 1670 1533 1347 1256 1141
[2, 0] 1236 2069 2411 2741 3089 3334 3424 3626 3733 3724
0.4
[0, 1] 3819 3387 2802 2527 2287 2010 1827 1719 1527 1432
[1, 0] 1089 1750 2160 2525 2757 3016 3140 3218 3527 3585
[1, 1] 4009 3227 2878 2481 2165 2005 1832 1684 1537 1431
[2, 0] 1084 1637 2161 2468 2792 2970 3202 3380 3410 3553
0.5
[0, 1] 4178 3525 3105 2833 2438 2306 2065 1959 1795 1678
[1, 0] 891 1469 1965 2233 2546 2758 2946 3059 3250 3325
[1, 1] 4039 3593 3055 2739 2490 2220 2071 1950 1778 1678
[2, 0] 893 1414 1876 2196 2527 2717 2919 3033 3178 3320
0.6
[0, 1] 4374 3664 3354 3048 2717 2499 2270 2165 2028 1893
[1, 0] 655 1228 1702 1977 2306 2489 2668 2896 2970 3087
[1, 1] 4287 3834 3319 3007 2719 2479 2340 2133 1991 1893
[2, 0] 685 1275 1626 1969 2259 2534 2723 2807 3012 3128
0.7
[0, 1] 4306 3943 3466 3180 2939 2719 2502 2329 2215 2072
[1, 0] 607 1078 1501 1805 2091 2362 2501 2675 2789 2910
[1, 1] 4449 3846 3542 3235 2923 2617 2457 2306 2203 2072
[2, 0] 639 1134 1492 1781 2048 2303 2541 2691 2794 2947
0.8
[0, 1] 4624 3997 3646 3386 3053 2835 2683 2514 2375 2224
[1, 0] 524 998 1351 1647 1956 2135 2323 2507 2598 2742
[1, 1] 4312 4009 3615 3318 3069 2864 2643 2491 2364 2224
[2, 0] 541 997 1389 1650 1923 2167 2352 2489 2664 2811
0.9
[0, 1] 4545 4127 3711 3496 3167 2973 2801 2657 2530 2362
[1, 0] 507 912 1268 1538 1803 2008 2209 2357 2488 2641
[1, 1] 4443 4043 3757 3448 3235 3007 2795 2648 2507 2362
[2, 0] 506 919 1265 1519 1796 2013 2196 2339 2476 2636
1.0
[0, 1] 4323 4067 3851 3602 3377 3144 2914 2739 2642 2500
[1, 0] 448 835 1124 1432 1656 1869 2058 2228 2369 2500
[1, 1] 4781 4263 3901 3533 3311 3118 2970 2805 2620 2500
[2, 0] 449 836 1125 1434 1657 1870 2059 2229 2370 2501
Digestion
Digestion
State 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
[0, 1] 428 788 1116 1388 1646 1925 2131 2327 2497 2665
[1, 0] 4350 4016 3585 3540 3309 3115 3029 2885 2782 2666
[1, 1] 211 411 536 709 865 933 1067 1144 1231 1343
[2, 0] 5012 4786 4764 4364 4181 4028 3774 3645 3491 3327
state: [0, 1] times: 2665
state: [1, 0] times: 2666
state: [1, 1] times: 1343
state: [2, 0] times: 2667
Hunt Success
State 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
[0, 1] 4026 3476 3140 2822 2530 2295 2083 1907 1792 1673
[1, 0] 851 1389 1889 2157 2511 2680 2884 3039 3220 3358
[1, 1] 4285 3664 3154 2809 2469 2274 2057 1943 1786 1673
[2, 0] 839 1472 1818 2213 2491 2752 2977 3112 3203 3297
state: [0, 1] times: 1673
state: [1, 0] times: 3358
state: [1, 1] times: 1673
state: [2, 0] times: 3297
This table shows when hunt success (at the top) is begin
varied and digestion is varied at the left.
Part of the code
h = [2]
a = [0]
state = [[2, 0]]
b = 1/2
#d = 1/3
u = 0
s = 2
for j in range(3):
d=0+0.1*j
for i in range(1, 10000):
dieroll = random.random()
if a[i - 1] == 0:
if dieroll < d:
h.append(h[i -1] - 1)
else:
h.append(h[i - 1])
if h[i] <= u:
a.append(1)
else:
a.append(0)
if a[i - 1] == 1:
if dieroll < b:
h.append(h[i - 1] + 1)
else:
h.append(h[i - 1])
if h[i] >= s:
a.append(0)
else:
a.append(1)
for i in range(len(a)):
state.append([h[i],a[i]])
num1 = 0
num2 = 0
num3 = 0
num4 = 0
for i in range(len(state)):
if state[i] == [0, 1]:
num1 = num1 + 1
elif state[i] == [1, 0]:
num2 = num2 +1
elif state[i] == [1, 1]:
num3 = num3 + 1
elif state[i] == [2, 0]:
num4 = num4 + 1
print ('[0, 1]', (num1))
print ('[1, 0]', (num2))
print ('[1, 1]', (num3))
print ('[2, 0]', (num4))

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Python Poster

  • 1. Modeling Animal Time Resource Allocation Using Python Cesar Chavez & Davi Mondragon New Mexico Alliance for Minority Participation Home Institution: Clovis Community College; Luna Community College Department of Mathematics, Eastern New Mexico University Dr. Brian Pasko Conclusions After running the simulation 10,000 times and varied the digestion we found that the animal stayed mostly in the state [1,0] and [2,0] when the digestion rate was small. As the digestion rate increased it skewed more towards the [0,1], [1,0] and [2,0] states. The animal spent most of its time resting when the digestion rate was small and as the digestion rate increased so did the number of times it feed. The opposite can be said when the hunt success rate was varied. The animal spent most of its time in the feed state and as hunt success increased the animal spent most if its time resting. Finally, we varied digestion and hunt success at the same time. When hunt success was 0.1 and digestion was 1.0; the animal spent most of its time resting just as when only digestion was varied. Again the opposite can be said about the hunt success rate when it was 1.0 and digestion was 0.1. The most outstanding result was when the digestion rate and hunt success was the same; the state of the animal seemed to be well balanced. The animal arrived at each stage 25% of the time. It was not skewed to the left or to the right, but was evenly distributed throughout each stage of hunt success or digestion. Objectives In this project we developed a working model using Python that represents time resource allocation for different animals. Once we have this model, we varied the variables gut level and digestion one at a time in order to see the impact these changes have on each other in the model. Once this is completed we want to add another factor which is prey size to see what we can derive from the resulted data. After obtaining these values we want to vary digestion and hunt success simultaneously to see the outcome. Lastly, we used Python to count the amount of times the animal was in each state for each set of outcomes to analyze. Implications The implication of this project is that Python can be used to model an infinite number of systems and different models for a variety of professional fields. It is predominantly used in mathematical fields, because it is excellent at calculating functions and modeling mathematical data. Python can also be used to develop or test any system that has expressible limits. The model in this project provides an insight to the behavior of animals and how factors like hunt successfully, gut level, and meal size affect the longevity of the animal. This project is an adequate example of how Python can be applied to a real life scenario such as animal feeding patterns to understand and learn from the models it generates. Materials & Methods: For this research project we used a computer with the Python software. To begin this project we had to learn the basic commands of the computer science language Python. Then, we started to write the computer code where we started with constants to ensure that only one variable was being tested at a time. For instance, only digestion would vary for the first trail and then hunt success would vary for the other trial. “h” is the current hunger level, “a” is the activity (resting, 0 or feeding, 1), “b” is the hunt success, “d” is the digestion rate, “u” the lower hunger set point where it began to feed, and “s” the upper hunger set point where it stopped feeding. The state where the animal began was at the stage [2, 0] where the number 2 is the current hunger and 0 is the activity. After a random number was generated to test if the animal would rest or feed which affected the activity and hunger stage of the animal. The simulation will run 10,000 times for the same animal, and keep its state whether it decided to feed or rest depending on the random number generated. Part of the code h = [2] a = [0] state = [[2, 0]] b = 1/2 #d = 1/3 u = 0 s = 2 for j in range(3): d=0+0.1*j for i in range(1, 10000): dieroll = random.random() if a[i - 1] == 0: if dieroll < d: h.append(h[i -1] - 1) else: h.append(h[i - 1]) if h[i] <= u: a.append(1) else: a.append(0) if a[i - 1] == 1: if dieroll < b: h.append(h[i - 1] + 1) else: h.append(h[i - 1]) if h[i] >= s: a.append(0) else: a.append(1) for i in range(len(a)): state.append([h[i],a[i]]) #print(state) num1 = 0 num2 = 0 num3 = 0 num4 = 0 num5 = 0 num6 = 0 num7 = 0 num8 = 0 num9 = 0 for i in range(len(state)): if state[i] == [0, 1]: num1 = num1 + 1 elif state[i] == [1, 0]: num2 = num2 +1 elif state[i] == [1, 1]: num3 = num3 + 1 elif state[i] == [2, 1]: num4 = num4 + 1 elif state[i] == [3, 1]: num5 = num5 + 1 elif state[i] == [4, 0]: num6 = num6 + 1 elif state[i] == [2, 0]: num7 = num7 + 1 else: num8 = num8 + 1 print ('[0, 1]', (num1)) print ('[1, 0]', (num2)) print ('[1, 1]', (num3)) print ('[2, 1]', (num4)) print ('[3, 1]', (num5)) print ('[4, 0]', (num6)) print ('[2, 0]', (num7)) print ('[3, 0]', (num8)) Abstract This project provides insight into time resource allocation in animals using the computer pro- gram Python. In this project Python is used to test and illustrate a model of an animal’s life cy- cle. The model provides a detailed representation of an animal’s behavior based on the required activities of feeding and resting. The independent variables are the rate of digestion (decreasing gut level) and hunt success (increasing gut level). They were varied simultaneously and concur- rently. During the experiment the state of the animal’s activity is tracked, feeding or resting. At each iteration, the gut level is changed randomly based on the current activity and the subse- quent activity is changed based on the new gut level. This computer model allows us to approx- imate an animal’s life cycle constructed on the variables of hunger and need for rest. State 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0.1 [0, 1] 2214 1730 1304 954 849 673 618 572 520 437 [1, 0] 2614 3289 3500 4023 4039 4498 4467 4446 4545 4854 [1, 1] 2734 1748 1265 965 870 664 656 608 504 437 [2, 0] 2439 3234 3932 4059 4243 4166 4260 4375 4432 4273 0.2 [0, 1] 3467 2448 2067 1645 1387 1248 1100 1001 920 832 [1, 0] 1647 2425 3053 3297 3605 3755 3925 4048 4150 4022 [1, 1] 3187 2569 1950 1713 1449 1269 1115 951 905 832 [2, 0] 1700 2559 2931 3346 3560 3729 3861 4001 4026 4315 0.3 [0, 1] 3828 2877 2593 2192 1913 1615 1538 1350 1244 1141 [1, 0] 1305 1961 2537 2808 3088 3382 3506 3678 3768 3995 [1, 1] 3632 3094 2460 2260 1911 1670 1533 1347 1256 1141 [2, 0] 1236 2069 2411 2741 3089 3334 3424 3626 3733 3724 0.4 [0, 1] 3819 3387 2802 2527 2287 2010 1827 1719 1527 1432 [1, 0] 1089 1750 2160 2525 2757 3016 3140 3218 3527 3585 [1, 1] 4009 3227 2878 2481 2165 2005 1832 1684 1537 1431 [2, 0] 1084 1637 2161 2468 2792 2970 3202 3380 3410 3553 0.5 [0, 1] 4178 3525 3105 2833 2438 2306 2065 1959 1795 1678 [1, 0] 891 1469 1965 2233 2546 2758 2946 3059 3250 3325 [1, 1] 4039 3593 3055 2739 2490 2220 2071 1950 1778 1678 [2, 0] 893 1414 1876 2196 2527 2717 2919 3033 3178 3320 0.6 [0, 1] 4374 3664 3354 3048 2717 2499 2270 2165 2028 1893 [1, 0] 655 1228 1702 1977 2306 2489 2668 2896 2970 3087 [1, 1] 4287 3834 3319 3007 2719 2479 2340 2133 1991 1893 [2, 0] 685 1275 1626 1969 2259 2534 2723 2807 3012 3128 0.7 [0, 1] 4306 3943 3466 3180 2939 2719 2502 2329 2215 2072 [1, 0] 607 1078 1501 1805 2091 2362 2501 2675 2789 2910 [1, 1] 4449 3846 3542 3235 2923 2617 2457 2306 2203 2072 [2, 0] 639 1134 1492 1781 2048 2303 2541 2691 2794 2947 0.8 [0, 1] 4624 3997 3646 3386 3053 2835 2683 2514 2375 2224 [1, 0] 524 998 1351 1647 1956 2135 2323 2507 2598 2742 [1, 1] 4312 4009 3615 3318 3069 2864 2643 2491 2364 2224 [2, 0] 541 997 1389 1650 1923 2167 2352 2489 2664 2811 0.9 [0, 1] 4545 4127 3711 3496 3167 2973 2801 2657 2530 2362 [1, 0] 507 912 1268 1538 1803 2008 2209 2357 2488 2641 [1, 1] 4443 4043 3757 3448 3235 3007 2795 2648 2507 2362 [2, 0] 506 919 1265 1519 1796 2013 2196 2339 2476 2636 1.0 [0, 1] 4323 4067 3851 3602 3377 3144 2914 2739 2642 2500 [1, 0] 448 835 1124 1432 1656 1869 2058 2228 2369 2500 [1, 1] 4781 4263 3901 3533 3311 3118 2970 2805 2620 2500 [2, 0] 449 836 1125 1434 1657 1870 2059 2229 2370 2501 Digestion Digestion State 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 [0, 1] 428 788 1116 1388 1646 1925 2131 2327 2497 2665 [1, 0] 4350 4016 3585 3540 3309 3115 3029 2885 2782 2666 [1, 1] 211 411 536 709 865 933 1067 1144 1231 1343 [2, 0] 5012 4786 4764 4364 4181 4028 3774 3645 3491 3327 state: [0, 1] times: 2665 state: [1, 0] times: 2666 state: [1, 1] times: 1343 state: [2, 0] times: 2667 Hunt Success State 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 [0, 1] 4026 3476 3140 2822 2530 2295 2083 1907 1792 1673 [1, 0] 851 1389 1889 2157 2511 2680 2884 3039 3220 3358 [1, 1] 4285 3664 3154 2809 2469 2274 2057 1943 1786 1673 [2, 0] 839 1472 1818 2213 2491 2752 2977 3112 3203 3297 state: [0, 1] times: 1673 state: [1, 0] times: 3358 state: [1, 1] times: 1673 state: [2, 0] times: 3297 This table shows when hunt success (at the top) is begin varied and digestion is varied at the left. Part of the code h = [2] a = [0] state = [[2, 0]] b = 1/2 #d = 1/3 u = 0 s = 2 for j in range(3): d=0+0.1*j for i in range(1, 10000): dieroll = random.random() if a[i - 1] == 0: if dieroll < d: h.append(h[i -1] - 1) else: h.append(h[i - 1]) if h[i] <= u: a.append(1) else: a.append(0) if a[i - 1] == 1: if dieroll < b: h.append(h[i - 1] + 1) else: h.append(h[i - 1]) if h[i] >= s: a.append(0) else: a.append(1) for i in range(len(a)): state.append([h[i],a[i]]) num1 = 0 num2 = 0 num3 = 0 num4 = 0 for i in range(len(state)): if state[i] == [0, 1]: num1 = num1 + 1 elif state[i] == [1, 0]: num2 = num2 +1 elif state[i] == [1, 1]: num3 = num3 + 1 elif state[i] == [2, 0]: num4 = num4 + 1 print ('[0, 1]', (num1)) print ('[1, 0]', (num2)) print ('[1, 1]', (num3)) print ('[2, 0]', (num4))