Sex-ratio Equilibrium_v1
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
(a general understanding of what the model is trying to show or explain)
HOW IT WORKS
(what rules the agents use to create the overall behavior of the model)
HOW TO USE IT
(how to use the model, including a description of each of the items in the Interface tab)
THINGS TO NOTICE
(suggested things for the user to notice while running the model)
THINGS TO TRY
(suggested things for the user to try to do (move sliders, switches, etc.) with the model)
EXTENDING THE MODEL
(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)
NETLOGO FEATURES
(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)
RELATED MODELS
(models in the NetLogo Models Library and elsewhere which are of related interest)
CREDITS AND REFERENCES
(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)
Comments and Questions
;; 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 9 years ago by Sugat Dabholkar.
Attached files
No files