Eye Brow Rule

No preview image

1 collaborator

N820644408_2280575_5702192 Lin He (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 4.1beta3 • Viewed 234 times • Downloaded 18 times • Run 2 times
Download the 'Eye Brow Rule' modelDownload this modelEmbed this model

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


WHAT IS IT?

This section could give a general understanding of what the model is trying to show or explain.

HOW IT WORKS

This section could explain what rules the agents use to create the overall behavior of the model.

HOW TO USE IT

This section could explain how to use the model, including a description of each of the items in the interface tab.

THINGS TO NOTICE

This section could give some ideas of things for the user to notice while running the model.

THINGS TO TRY

This section could give some ideas of things for the user to try to do (move sliders, switches, etc.) with the model.

EXTENDING THE MODEL

This section could give some ideas of things to add or change in the procedures tab to make the model more complicated, detailed, accurate, etc.

NETLOGO FEATURES

This section could point out any especially interesting or unusual features of NetLogo that the model makes use of, particularly in the Procedures tab. It might also point out places where workarounds were needed because of missing features.

RELATED MODELS

This section could give the names of models in the NetLogo Models Library or elsewhere which are of related interest.

CREDITS AND REFERENCES

This section could contain a reference to the model's URL on the web if it has one, as well as any other necessary credits or references.

Comments and Questions

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

Click to Run Model

globals
[
  found-match?      ;; whether a new match is found
  upperbound        ;; upperbound of age according to the eye-brow-rule
  lowerbound        ;; lowerbound of age according to the eye-brow-rule
  married-percentage;; percentage of married adults
  total-population  ;; total number of people
  children          ;; total number of children (age < 16)
  adult             ;; total number of adult 
  senior            ;; total number of senior (age > 60)
  married           ;; total number of married
  female            ;; total number of women
  male              ;; total number of men
  infant_fm         ;; percentage of female in children
  adult_fm          ;; percentage of female in adult
  senior_fm         ;; percentage of female in senior
]

breed [women woman]       ;; female in society
breed [men man]           ;; male in society

turtles-own [
  age                     ;; age of the person
  married?                ;; marriage status
  ]

women-own [
  attractiveness          ;; level of attractiveness, scale of 0 to 10, 10 being the highest
  my-date                 ;; the man she is dating
  my-children             ;; number of her children
  ] 
 
men-own [
  wealth]                 ;; level of wealth, scale of 0 to 10, 10 being the highest

to setup
  clear-all
  set-default-shape women "person"
  ;; create women
  create-women initial-number-women
  [
    setxy random-xcor random-ycor
    set age random 80
    set color pink - age * 0.125 + 5
    ifelse age <= 16
    [ set size 0.09375 * age]
    [ set size 1.5]
    set attractiveness random 10
    set married? false
    set my-children 0
  ]
  ;; create men
  set-default-shape men "person"
  create-men initial-number-men
  [
    setxy random-xcor random-ycor
    set age random 80
    set color blue - age * 0.125 + 5
    set wealth random 10
    ifelse age <= 16
    [ set size 0.09375 * age]
    [ set size 1.5]
    set married? false
  ]
  set found-match? false
  update-data
end 

to go
  ask turtles with [ not married?]
  [
    wiggle
  ]
  ;; single women attracts men around them
  ask women with [ not married?]
  [ if age > 16
    [ date]
  ]
  ;; married women give birth to children
  ask women with [ married?]
    [ if my-children < 3
      [ birth]
    ]
  ;; grow old and die
  ask turtles
  [ grow-old
    death
  ]  
  tick
  every 1
  ;; update plots
  [ update-data
    do-plot 
  ]
end 


;; wandering around

to wiggle
  rt random 360 
  forward random 10
end 

;; date man around her, get married

to date
  eye-brow-rule
  set my-date one-of men-on patches in-radius attractiveness
  if my-date != nobody
  [ ask my-date
;    [ if age >= lowerbound and age <= upperbound
;      [
;        move-to myself
;        if random 50 + 5 * wealth > 10 
        [ 
          set married? true
          set found-match? true
        ]
;      ]
;    ]
  ]
  if found-match?
  [
    set married? true
    set found-match? false
  ]
end 

;; eye brow rule

to eye-brow-rule
  set upperbound ( 2 * ( age - 7) ) * ( 100 - tolerance ) / 100
  set lowerbound ( 2 * ( age - 7) ) * ( 100 + tolerance ) / 100
end  

;; give birth

to birth
  if random 100 <= birth-rate
  [
    ifelse random 100 < 50
      [ 
        hatch-women 1 
        [ 
          set age 0
          set color pink + 5
          set size 0.01
          set attractiveness random 20
          set married? false
          rt 360
          forward 1
        ]
      ]
      [ 
        hatch-men 1
        [
          set age 0
          set color blue + 5
          set size 0.01
          set wealth random 10
          set married? false
          rt 360
          forward 1
        ]
      ]
    set my-children my-children + 1
  ]
end 

;; die

to death
  ifelse age >= 80 
    [ die]
    [ if age >= 40
      [ if random 100 < accident-rate
        [die]
      ]
    ] 
end 

;; grow old

to grow-old
  set age age + 1
  set color color - 0.125
  ifelse age <= 16
  [ set size 0.09375 * age]
  [ set size 1.5]  
end 

;; update data

to update-data
  set total-population count turtles
  set children count turtles with [ age <= 16 ]
  set senior count turtles with [ age > 60 ]
  set adult total-population - children - senior 
  set married count turtles with [ married? ]
  set female count women
  set male count men
  ifelse children != 0 and senior != 0
  [ set infant_fm count women with [ age <= 16 ] / children * 100
  set senior_fm count women with [ age >= 60 ] / senior * 100 ]
  [ stop ]
  ifelse total-population != 0
  [
    set married-percentage married / ( total-population - children) * 100
  ]
  [ stop ]
end 

;; draw plots

to do-plot  
  set-current-plot "married-percentage"
  plot married-percentage
  set-current-plot "total-population"
  plot total-population
end 

There is only one version of this model, created over 14 years ago by Lin He.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.