Sex Ratio Equilibrium Extension 2

No preview image

1 collaborator

My_photo_2 Sugat Dabholkar (Author)

Tags

evolution 

Tagged by Sugat Dabholkar over 8 years ago

Model group MAM-2016 | Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.0-M5 • Viewed 404 times • Downloaded 31 times • Run 0 times
Download the 'Sex Ratio Equilibrium Extension 2' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Info tab cannot be displayed because of an encoding error

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [
  sex-ratio-list  ;; global-variable to track time-series data (for behavior space experiment)
  ]
breed [males male]
breed [females female]
;;
females-own [
  partner
  carrying?                   ;; boolean to track if a female is carrying a child after mating
  male-child-chance           ;; this is a probability of giving birth to a male child
  temp-male-child-chance      ;; a variable to store male-chind-chance for a particular father-mother pair
  child-male-child-chance     ;; it is the inherited male-child-chance by a child
  gestation                   ;; a veriable to track time of carrying a child till a female reachers gesatation-period
  age
]

males-own [
  partner
  male-child-chance
  child-male-child-chance
  age
]

;;set-up pupulation of males and females

to setup
  ca
  create-males round ( ( 1 - ini-sex-ratio ) * ini-number ) [
    setxy random-xcor random-ycor
    set shape "male"
    set color green
    set male-child-chance random-normal ini-average-male-child-chance 0.1        ;; males are assinged initial male-child-chance from a random-normal distribution
    set age 0
    set partner nobody
  ]
  create-females round ( ini-sex-ratio * ini-number ) [
    setxy random-xcor random-ycor
    set color blue
    set shape "female"
    set carrying? false
    set partner nobody
    set male-child-chance random-normal ini-average-male-child-chance 0.1        ;; females are assinged initial male-child-chance from a random-normal distribution
  ]
  set sex-ratio-list []
  reset-ticks
end 

to go
  if not any? turtles [stop]
  ask males [
    check-if-dead
    move
    search-a-partner
  ]
  ask females [
    check-if-dead
    if not carrying? [move]
    reproduce
  ]
  update-sex-ratio-list
  tick
end 

to move
    rt random 60
    lt random 60
    fd 1
end 

to search-a-partner
  if count females in-radius 1 with [not carrying?] = 1 and count other males in-radius 1 = 0  [   ;; spatial restriction is used to incorporate density-dependant growth rate
    set partner one-of females in-radius 1 with [not carrying?]
    ]
    if partner = nobody [stop]
    ifelse [partner] of partner != nobody [
      set partner nobody
      stop                        ;; just in case two males find the same partner
    ]
    [
      ifelse random-float 1 < mating-chance [
        ask partner [
          set partner myself
          set carrying? true
          set color orange    ;; color oragne indicates carrying female
          set child-male-child-chance ( ( 1 - inheritance-weight ) * male-child-chance ) +  ( inheritance-weight * ( [male-child-chance] of myself ) )         ;; this is inherited male-child-chance by a child (determined by father and mother according to inheritance-weight)
          set temp-male-child-chance ( ( 1 - sex-determination-weight ) * male-child-chance ) +  ( sex-determination-weight * ( [male-child-chance] of myself ) )   ;; sex of a child is determined by male-child-chance (determined by father and mother according to sex-determination-weight)
        ]
        set partner nobody
      ]
      [
        set partner nobody
      ]
    ]
end 

to reproduce
    if carrying? [
      ifelse gestation = gestation-period [   ;; genstation-period can be set. When it's over, a female gives birth to a a child, starts afrest and can have a new partner
        set gestation 0
        set carrying? false
        set color blue
        set partner nobody
        repeat random max-litter-size + 1 [
          ifelse random-float 1 < temp-male-child-chance [    ;; sex of a child is determined by male-child-chance
            hatch 1 [
              set breed males
              set shape "male"
              set color green
              set male-child-chance random-normal child-male-child-chance 0.1
              set age 0
            ]
          ][
          hatch 1 [
            set male-child-chance random-normal child-male-child-chance 0.1
            set age 0
          ]
          ]
        ]
      ][
      set gestation gestation + 1
      ]
    ]
end 

to check-if-dead
    ifelse random-float longevity < age [
      die
    ][
    set age age + 1
    ]
end 

;; reporting procedures for plotting and for behaviorspace experiments

to-report female-percentage
  ifelse any? turtles [
    report ( count females / count turtles ) * 100
  ]
  [
    report 0
  ]
end 

to-report average-male-child-chance
  ifelse any? males [
    report mean [male-child-chance] of males
  ]
  [
    report 0
  ]
end 

to update-sex-ratio-list
  if ticks > 10000 [
    set sex-ratio-list lput female-percentage sex-ratio-list
  ]
end 

to-report average-sex-ratio
    ifelse length sex-ratio-list > 0 [
    report precision mean sex-ratio-list 2]
    [report 0]
end 

to-report sd-sex-ratio
    ifelse length sex-ratio-list > 0 [
    report precision standard-deviation sex-ratio-list 2]
    [report 0]
end 

There is only one version of this model, created over 8 years ago by Sugat Dabholkar.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.