BehaviourComposer: ignore everything before this.Grass growth rate oscillates throughout the year due to temperature changes e.g. in Yellowstone National Park where predators and prey have been battling it out for thousands of years. For example wolves eat the following prey:  elk 87%, moose 2.5%, deer 1.5%, antelope 1%, bison 1%, coyote 1%, mountain goats 0.2%, beaver 0.2%. When grasses are scarce in the winter the prey is typically weakened which means the wolves can hunt more easily. When grasses are plentiful the wolves find it harder to catch prey. Predator and prey models can be very sensitive to change in the environment. A large rise in the availability of grasses (perhaps in a longer and warmer year) could trigger the extinction of both predator and prey. High grass availability may cause a rapid rise in prey numbers, which causes the same effect in predators who then hunt all the prey and then die out themselves. If the predators are hunting the weakest prey and the strongest predators get the most food (so have the best survival chances) then the fitness of each gene pool will be optimised.Seasonal variation tips the balance between each species so is an important evolutionary factor. Begin micro-behaviour GRASS GROWTH RATE OSCILLATES Begin NetLogo code: do-every the-lengthofseason [ ;; If the the-grass-regrowth-time is ascending keep it doing so if the-prevgr < the-grass-regrowth-time and the-grass-regrowth-time <= the-maxgr [ set the-prevgr the-grass-regrowth-time set the-grass-regrowth-time the-grass-regrowth-time + the-rateofchange ] ;; When the-grass-regrowth-time reaches the-maxgr reset the-prevgr and the-grass-regrowth-time if the-grass-regrowth-time >= the-maxgr [ set the-prevgr the-grass-regrowth-time set the-grass-regrowth-time the-grass-regrowth-time - the-rateofchange ] ;; If the the-grass-regrowth-time is descending keep it doing so( if the-prevgr > the-grass-regrowth-time and the-grass-regrowth-time > 0 [ set the-prevgr the-grass-regrowth-time set the-grass-regrowth-time the-grass-regrowth-time - the-rateofchange ] ;; If the the-grass-regrowth-time is ascending keep it doing so( if the-grass-regrowth-time <= 0 [ set the-prevgr 0 set the-grass-regrowth-time the-grass-regrowth-time + the-rateofchange ] ] End NetLogo code How this worksThis works by adding a value (rateofchange) to the current growth rate (the-gr) if the previous growth rate (prev-gr) was less AND the growth rate has not exceeded a maximum value (90) here called the-max-gr. If the-gr equals max-gr then the code begins to subtract a value (rateofchange) until the-gr reaches zero. So in summary this causes a value (the-gr) to oscillate linearly between 0 and 90. Variants
Related behaviourstext HistoryLast edited (most recent first):
BehaviourComposer: ignore everything after this. |
Projects‎ > ‎PredatorPreySimpleBehaviours‎ > ‎