Herding Behavior

Hardy-Weinberg Equilibrium

Prepared by: Becky Bamber

 

Herding Behavior

Background Information

Applications

Programming

Results

References

Back to Main Page

 

Background Information

Herds are simply groups of animals, including people. They also could be classified as a cascade. A cascade is where an individual makes decisions based upon something that has already happend regarless of whether or not it is the correct thing to do. An example of this would be: there is a group of people who are all going to one place, there is one person who knows exactly how to get there and another person who knows part of the way but not the exact route. Everyone opts to follow the one who knows exactly where to go, but along the way the person leading makes a mistake and the person who was unsure of the way knows that it is the wrong way to go but still opts to follow the rest of the group instead of going in the corrent way. With people, this behavior can be the result of peer pressure and a desire to follow the group instead of going against it as we have an unconscious desire to be a part of something and not be alone. In the animal world, most animals live in groups for many reason including safety, and making food easier to find. Animals do not want to be separated from a group and will do anything to rejoin the group.

Applications

  • Study of social structure
  • Mate selection in animals will occur in sometimes i.e. females picking most popular male to mate with
  • Understanding animal social behavior to use it in management of livestock other species will exploit this to get animals to move in a desired manner. Examples of this are dogs herding cattle or sheep and cutting horses used to separate a single cow from a group
  • In economics to study the cost demand relationship
  • Understand the mechanics behind bank runs and panics
  • The financial world uses this to monitor trends, as the behavior seen with these trends will cause them to become more exaggerated

Programming

The general algorithm is for animals to be placed randomly and to move at a semi random heading until one meets up with another and then they move in a similar manner. Originally the goal was to have individuals form their own groups and change color to indicate their group affiliation. For some reason this did not work, all the animals turned black and ceased to move. So a modification was made such that the animals will group according to their color, making it easy to see what they are doing and to observe the group behavior. This is not unrealistic as people will form groups based on similar values and ideas. One other thing to note is that two animals can occupy the same space and will still act accordingly to their group. In this simulation you can modify how many animals there are in the space and how large a step they can take. These two modifications will cause different behaviors to be seen as it demonstrates how the size of a trend/decision can impact the group.

Observer Code

turtles-own [closest closest-distall closest-dist]

to setup
ca
ask-patches[setpc 53]
create-and-do numan
[setshape sheep-shape setxy random screen-width random screen-height]
end

Turtle Code

to move
let [:mycolor color]
let [:findclosest who-min-of-turtles-with [color = :mycolor][distance xcor-of myself ycor-of myself]]
let [:findnext who-min-of-turtles [distance xcor-of myself ycor-of myself]]
setclosest first :findclosest
setclosest-dist last :findclosest
setclosest-distall first :findnext
ifelse closest-distall < 3 or closest-dist < 3 [turn (180 + towards xcor-of closest ycor-of closest) 25]
[ifelse closest-dist > 4 [turn (towards xcor-of closest ycor-of closest) 45]
[turn (heading-of closest) 5]]
let [:step size]
fd :step * .01
end

to turn :other-heading :degrees
ifelse ((:other-heading >= heading) and ((:other-heading - heading) <= :degrees)) or ((:other-heading <= heading) and ((heading - :other-heading) <= :degrees))
[seth :other-heading]
[ifelse ((:other-heading - heading) mod 360) < 180
[rt :degrees]
[lt :degrees]]
end

Results

Herding algorithm: View online

If that doesn't work, you can download the StarLogo package from their homepage at http://education.mit.edu/starlogo/ and my .slogo project file from below

Herding algorithm: Right-click and select 'Save as' herd.slogo

 

References

  1. http://welch.econ.brown.edu/cascades/
  2. http://www.red3d.com/cwr/boids
  3. http://www.cc.gatech.edu/gvu/animation/Areas/group_behavior/group.html

 

 

Hardy-Weinberg Equilibrium

 

Back to Main Page

 

Background Information

This is a genetic principle that states that the frequency of genes of a rondomly mating population will remain constant as long as there is no selection, no mutation and no new animals are added to a population. This was going to be used to simulate what happens in a population whenall of these things are carried out and then to allow various changes to occur such as mutation to see how it would affect the population.

Programming

This did not happen due to difficulties observed within the herding behavior as well as the complexity of this problem. These things include detection of the location of another animal, in the herd behavior for some reason they are not detecting if another is within a certain distance and this is a highly necessary attribute for this algorithm. The other prolem is detecting color of another individual, there were problems with this and color would have been crucial to this.

General Algorithm for what would have had to be done

    1. Start with 10 yellow individuals and 10 blue individuals placed randomly and age is set to 0.

    2. If another animal is at my location then: generate a random number and if above .5 then reproduce

    To reproduce:

    Get my color

    Generate a random number, random

    If one color is yellow or blue

    if colors match then new individual is my color

    if colors are opposite (if I am blue, then it is yellow) then new individual is green

    if other is green

    if one blue and random above .5 new individual is blue else new individual is green

    if one yellow and random above .5 new individual is yellow else new individual is green

    if other iis purple

    if one blue and random above .5 new individual is blue else new individual is purple

    if one yellow and random above .5 new individual is green else new individual is orange

    if other is orange

    if one blue and random above .5 new individual is green else new individual is purple

    if one yellow and random above .5 new individual is yellow else new individual is orange

    If one color is green

    if other is green and random below .25 new individual is blue, if between .25 and .75 new individual is green else new individual is yellow

    if other is purple and random below .25 new individual is green, if between .25 and .5 new individual is orange, if between .5 and .75 new individual is blue else new individual is purple

    if other is orange and random below .25 new individual is yellow, if between .25 and .5 new individual is green, if between .5 and .75 new individual is orange else new individual is purple

    If one color is purple

    if other is purple and random below .25 new individual is blue, if between .25 and .75 new individual is purple else new individual is red

    if other is orange and random below .25 new individual is green , if between .25 and .5 new individual is orange, if between .5 and .75 new individual is red else new individual is purple

    If both colors are orange and random below .25 new individual is yellow, if between .25 and .75 new individual is orange else new individual is red

    Age increments

    3. if age equals 2 then individual dies

    4. Allow selection: if color is yellow then die

    5. Allow migration: bring in 9 blue and 1 yellow individuals

    6. Allow mutation: Allowing for different number of mutated individuals to be introduced, new individual is purple which is one blue allele and one red (red is mutation)