Vous êtes sur la page 1sur 9

Evolution of 2 Organisms in a sealed Ecosystem

For this report I will be


investigating the effects that varying
environmental pressures will have on 2
distinct species. I will also be observing
how their interaction with each other
will influence their development.
This was partially inspired by a
piece of coursework I completed in my
3rd year where we had to write code to
simulate the classic Wolf, Sheep,
Cabbage problem. For this report, my 2
organisms will be wolves and sheep.
Cabbage will be indirectly present as a
food source for the sheep.
My initial project proposal was
to simulate an organism based on the
slime mold Physarum polycephalum
spreading through a network in an
attempt to find the most efficient
route through, and to find the
minimum spanning tree (MST) for the
network.
Whilst learning how to use
NetLogo in order to implement this I
realised that this would be beyond my
abilities for a beginner at NetLogo, as it
is very hard to create node graphs of a
specific format that are not
interconnected at random. Whilst I am
certain that this is possible, I decided
that it would waste too much time
trying to create this and moved on to a
basic simulation of evolution.
Edward Chantler 12018620

In the simulation, the wolves


will be represented by red arrows, and
the sheep will be represented by blue
arrows. For the evolution, I will be
using the definition of evolution as
The non-random selection of random
mutations. This will be implemented
by there being a chance of parameters
of the wolves and sheep changing
when they breed.
Both the wolves and sheep will
be spawned at random locations in the
world. The world will be empty aside
from grass. The grass will be consumed
by the sheep in order to breed. The
wolves will breed by consuming the
sheep when they are within a certain
distance of each other. The grass will
have a 3% chance to regrow each tick
once it has been eaten. The sheep use
1 energy to move, and the wolves use
2 energy to move at the beginning of
the simulation. If either a wolf or a
sheep has no energy, it dies. The sheep
begin the simulation with a 5% chance
to survive a wolf attack. The simulation
begins with 10 wolves and 20 sheep.
Both wolves and sheep will have
an energy variable which will be used
to move around the world and breed.
Possible mutations for the sheep will
be reduced energy to breed and a
small but increasing chance for them

to survive wolf attacks. Mutations for


the wolves will be increased
movement speed coupled with
increased energy expenditure, and an
increased ability to eat sheep to
counteract the sheeps survivability. In
all cases there will be a 2% chance of
mutation.
All simulations use a series of
assumptions. All of their ecosystems
are completely sealed form outside
interference. All mutations will be
potentially beneficial. 2 mutations
cannot occur at once. Mutations are
guaranteed to be passed down to
offspring.
All simulations will be run 10
times for 500 ticks each, and the data
will be presented in a table with
median and mean values displayed.

Simulation ID Wolves Sheep


1
104
96
2
119
76
3
76
127
4
92
115
5
112
93
6
83
60
7
78
135
8
99
109
9
98
94
10
81
123

Mean
Median

94.2
95

102.8
102.5

Figure 1. Mean and Median values for


surviving wolves and sheep with no
evolutionary mechanics.

I did this test in order to


observe what changes the evolution
would have on survival rates.

I hypothesise that the


movement of the wolves will stay the
same, and that both the wolves
hunting ability and the sheeps survival
ability will increase to combat each
other. The increase will need to 5% in
order for it to be significant. My null
hypothesis is that none of the above
will occur
Before I implemented the
mutations, I ran the simulation 10
times and took an average of the
surviving wolves and sheep.

Edward Chantler 12018620

Figure 2. Graph showing the changes in


numbers of wolves and sheep over time with
no evolutionary mechanics.

All of the following tables have


the relevant statistics averaged for
each simulation.
First of all, I implemented only
the wolves mutations in order to try
and observe which traits if any were
selected for.
Simulation ID Wolves Sheep
Wolf Hunting Ability
1
159
106
95
2
211
85
96
3
56
50
97
4
153
55
97
5
177
67
97
6
0
0
0
7
75
164
97
8
65
104
96
9
162
36
97
10
150
84
97

Mean
Median

120.8
151.5

75.1
76

86.9
97

Figure 3. Mean and Median values for


surviving wolves and sheep with only wolf
evolution implemented.

In all cases, the median


movement speed and energy
expenditure of the wolves didnt
increase beyond 1 showing that in this
model wolves with lower energy
expenditure were selected. The base
hunting ability is 95, so this model
selected for wolves with a slightly
higher hunting ability.
Next, I implemented a model
with only the sheep mutations
implemented.

Edward Chantler 12018620

Simulation ID Wolves Sheep


Survival
1
86
121
2
58
65
3
401
108
4
0
0
5
179
165
6
220
223
7
0
346
8
420
43
9
73
50
10
0
327

Mean
Median

143.7
79.5

144.8
114.5

102
100
100
0
101
100
101
101
101
100

Breeding
42
45
39
0
46
38
44
30
43
47

90.6
100.5

37.4
42.5

Figure 4. Mean and median value for surviving


sheep and wolves with only sheep evolution
implemented.

The beginning survival rate for


sheep is 100, and a increase increases
a sheeps chance of survival, so I was
surprised that it did not increase more.
The base breeding value is 50, and
decreasing it increases the rate at
which sheep breed, so it decreased as I
expected. The increased breeding rate
resulted in a larger food source for the
wolves, which had higher numbers of
survivors. The number of surviving
sheep also increased.

Finally, I ran simulations that


implemented both the wolf and sheep
evolution.
Simulation ID Wolves Sheep
Hunting
1
0
317
2
80
240
3
141
68
4
215
89
5
125
57
6
247
95
7
112
51
8
283
120
9
115
134
10
304
167
Mean
Median

162.2
133

133.8
107.5

0
95
97
97
95
95
96
96
95
95
86.1
95

Movement Survival Breeding


0
100
48
1
101
39
1
101
39
1
101
45
1
102
47
1
100
35
1
102
42
1
102
43
1
101
44
1
101
38
0.9
1

101.1
101

Figure 5. Mean and median values for


surviving sheep and wolves with all evolution
implemented.

Edward Chantler 12018620

42
42.5

In conclusion, I believe that the


null hypothesis has been proven.
Whilst there appear to be significant
differences in the averaged variables
from their default, this is due to a few
instances where all of the sheep and or
wolves have died. If I look at the
median values, there is no significant
difference.
I believe that allowing the
simulations to run longer would have
produced more significant difference
in the organisms.

Code Appendix
globals [forfight forsurvive chance formove averagesurvive averagebreed averagefight averagemovement]
breed [wolves wolf]
breed [sheeps sheep]
wolves-own [wenergy fight movement]
sheeps-own [energy breeding survive]

to setup
clear-all
setup-patches
setup-wolves
setup-sheeps
reset-ticks
end
to go
if ticks >= 500 [ stop ]
move-wolves
move-sheeps
eat-grass
check-sheep-death
check-wolf-death
reproduce-sheep
regrow-grass
tick
end

to setup-patches
ask patches [set pcolor green]
end
to setup-wolves
create-wolves 10[setxy random-xcor random-ycor set color red set wenergy 50 set fight 95 set movement 1]
end
to setup-sheeps
create-sheeps 20[setxy random-xcor random-ycor set color blue set energy 20 set breeding 50 set survive
100]
end

to move-wolves

Edward Chantler 12018620

ask wolves
[
ifelse random 2 = 1
[
right random 60
]
[
left random 60
]
forward movement
set wenergy wenergy - (movement + 1)
if count other turtles-here with [color = blue] = 1
[
ask other turtles-here with [color = blue]
[
set forsurvive survive
]
set forfight fight
set chance forsurvive - forfight
if random 100 > chance
[
ask other turtles-here with [color = blue]
[
set energy 0
]
if random(100) < 2
[
ifelse random 2 = 1
[
set fight fight + 1
]
[
set movement movement + 1
]
]
set wenergy wenergy + 10
hatch 1
]
]
]
end
to move-sheeps
ask sheeps
[

Edward Chantler 12018620

ifelse random 2 < 1


[
left random 60
forward 1
set energy energy - 1
]
[
right random 60
forward 1
set energy energy - 1
]
]
end
to eat-grass
ask sheeps
[
if pcolor = green
[
set pcolor black
set energy energy + 10
]
]
end
to reproduce-sheep
ask sheeps
[
if energy > 50
[
if random (100) < 2
[
ifelse random 2 = 1
[
set survive survive + 1
]
[
set breeding breeding - 5
]
]
set energy energy - breeding
hatch 1 [set energy 50]
]
]

Edward Chantler 12018620

end

to regrow-grass
ask patches
[
if random 100 < 3 [ set pcolor green ]
]
end
to check-sheep-death
ask sheeps
[
if energy <= 0 [die]
]
end
to check-wolf-death
ask wolves
[
if wenergy <= 0 [die]
]
end
to print-wolves
set averagefight 0
set averagemovement 0
ask wolves
[
set averagefight averagefight + fight
set averagemovement averagemovement + movement
]
set averagefight averagefight / count wolves
set averagemovement averagemovement / count wolves
print (sentence averagefight averagemovement)
end
to print-sheeps
set averagesurvive 0
set averagebreed 0
ask sheeps
[
set averagesurvive averagesurvive + survive
set averagebreed averagebreed + breeding
]
set averagesurvive averagesurvive / count sheeps
set averagebreed averagebreed / count sheeps
print (sentence averagesurvive averagebreed)
end

Edward Chantler 12018620

Edward Chantler 12018620

Vous aimerez peut-être aussi