Sex-ratio Equilibrium_v1

No preview image

1 collaborator

My_photo_2 Sugat Dabholkar (Author)

Tags

(This model has yet to be categorized with any tags)
Child of model sex-ratio-equilibrium
Model group MAM-2016 | Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.0-M5 • Viewed 326 times • Downloaded 19 times • Run 0 times
Download the 'Sex-ratio Equilibrium_v1' modelDownload this modelEmbed this model

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


Comments and Questions

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

Click to Run Model

;; sexual reproduction (XX-XY type) and growth model

;;
turtles-own [
  partner
  carrying?
  male-child-chance
  gestation
  age
  gender
]

;;set-up pupulation of males and females

to setup
  ca
  crt ini-number [
    setxy random-xcor random-ycor
    set shape "male" set size 3
    set gender "male"
    set color green
    set male-child-chance random-normal ini-average-male-child-chance 0.1
    set age 0
    set partner nobody
    set carrying? false
  ]
  ask n-of round ( ini-sex-ratio * ini-number ) turtles [
      set color blue
      set shape "female" set size 3
      set gender "female"
      set male-child-chance 0
  ]
  reset-ticks
end 

to go
  if not any? turtles [stop]
  check-if-dead
  move
  search-a-partner
  reproduce
  tick
end 

to move
  ask turtles [
    rt random 60
    lt random 60
    fd 1
  ]
end 

to search-a-partner
  let male-turtles turtles with [gender = "male"]
  ask male-turtles [
    set partner one-of (other turtles-here with [gender = "female" and 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 male-child-chance [male-child-chance] of myself  ;; sex of a child is determined by male-child-chance (determined by father)
        ]
      ]
      [
        set partner nobody
      ]
    ]
  ]
end 

to reproduce
  let female-turtles turtles with [gender = "female"]
  ask female-turtles [
    if carrying? [
      ifelse gestation = gestation-period [   ;; genstation- period is 9 months. when it's over, a female produces a child and starts afrest and can have a new partner.
        set gestation 0
        set carrying? false
        set color green
        set partner nobody
        repeat litter-size [
          ifelse random-float 1 < male-child-chance [    ;; sex of a child is determined by male-child-chance (determined by father)
            hatch 1 [
              set gender "male"
              set shape "male"
              set color green
              set male-child-chance random-normal male-child-chance 0.1
              set age 0
            ]
          ][
          hatch 1 [
            set gender "female"
            set color blue
            set male-child-chance 0
            set age 0
          ]
          ]
        ]
      ][
      set gestation gestation + 1
      ]
    ]
  ]
end 

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

to-report female-percentage
  ifelse any? turtles [
    report ( count turtles with [gender = "female"] / count turtles ) * 100
  ]
  [
    report 0
  ]
end 

to-report average-male-child-chance
  ifelse any? turtles with [gender = "male"] [
    report mean [male-child-chance] of turtles with [gender = "male"]
  ]
  [
    report 0
  ]
end 

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

Attached files

No files

Parent: sex-ratio-equilibrium

This model does not have any descendants.

Graph of models related to 'Sex-ratio Equilibrium_v1'