voter 3

No preview image

1 collaborator

Default-person yl tn (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.0 • Viewed 138 times • Downloaded 11 times • Run 0 times
Download the 'voter 3' 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

globals [
 total-population
 total-voted
]

breed [ voters1 voter1 ]
breed [ voters2 voter2 ]
breed [ voters3 voter3 ]
breed [ voters4 voter4 ]

turtles-own [
 participation-rate
]

voters1-own [
  voted1
]

voters2-own [
  voted2
]

voters3-own [
  voted3
]

voters4-own [
  voted4
]

to setup
  clear-all
  setup-patches
  setup-voters-1
  setup-voters-2
  setup-voters-3
  setup-voters-4
  set total-population count turtles
  set total-voted 0
  reset-ticks
end 

to go
  vote
end 

to setup-patches
end 

to setup-voters-1
  create-voters1 Desert-Population [
    set color red
    set shape "person"
    set heading 0
    set participation-rate Desert-Voter-Turnout
    set voted1 0
  ]
  ask voters1 [
    move-to one-of patches with [pxcor < -10 and pycor < 0 and pycor >= -10 and not any? turtles-here ]
  ]
end 

to setup-voters-2
  create-voters2 Ocean-Population [
    set color blue
    set shape "person"
    set heading 0
    set participation-rate Ocean-Voter-Turnout
    set voted2 0
  ]
  ask voters2 [
    move-to one-of patches with [pxcor >= -10 and pxcor < 0  and pycor < 0 and pycor >= -10 and not any? turtles-here ]
  ]
end 

to setup-voters-3
  create-voters3 Forest-Population [
    set color green
    set shape "person"
    set heading 0
    set participation-rate Forest-Voter-Turnout
    set voted3 0
  ]
  ask voters3 [
    move-to one-of patches with [pxcor >= 1 and pxcor <= 10 and pycor < 0 and pycor >= -10 and not any? voters3-here ]
  ]
end 

to setup-voters-4
  create-voters4 Mountain-Population [
    set color gray
    set shape "person"
    set heading 0
    set participation-rate Mountain-Voter-Turnout
    set voted4 0
  ]
  ask voters4 [
    move-to one-of patches with [pxcor > 10 and pxcor <= 20 and pycor < 0 and pycor >= -10 and not any? voters4-here ]
  ]
end 

to vote
  ask turtles [
    if random 100 < participation-rate [
      fd 15
      if breed = voters1 [ set voted1 voted1 + 1 ]
      if breed = voters2 [ set voted2 voted2 + 1 ]
      if breed = voters3 [ set voted3 voted3 + 1 ]
      if breed = voters4 [ set voted4 voted4 + 1 ]
    ]
  ]
  set total-voted total-voted + sum [voted1] of voters1 + sum [voted2] of voters2 + sum [voted3] of voters3 + sum [voted4] of voters4
end 

There are 2 versions of this model.

Uploaded by When Description Download
yl tn about 7 years ago quick Download this version
yl tn about 7 years ago Initial upload Download this version

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.