Voting-Gender

No preview image

1 collaborator

55 Nathan Holbert (Author)

Tags

voting 

Tagged by Marzieh Jahanbazi about 8 years ago

Child of model Voting preview imageVoting
Model group CCL | Visible to everyone | Changeable by group members (CCL)
Model was written in NetLogo 5.0.4 • Viewed 363 times • Downloaded 14 times • Run 0 times
Download the 'Voting-Gender' 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 model is a simple cellular automaton that simulates voting distribution by having each patch take a "vote" of its eight surrounding neighbors, then perhaps change its own vote according to the outcome.

HOW TO USE IT

Click the SETUP button to create an approximately equal but random distribution of blue and green patches. Click GO to run the simulation.

When both switches are off, the central patch changes its color to match the majority vote, but if there is a 4-4 tie, then it does not change.

If the CHANGE-VOTE-IF-TIED? switch is on, then in the case of a tie, the central patch will always change its vote.

If the AWARD-CLOSE-CALLS-TO-LOSER? switch is on, then if the result is 5-3, the central patch votes with the losing side instead of the winning side.

THINGS TO NOTICE

Watch how any setup quickly settles to a static state when both switches are off.

Watch what happens when only the CHANGE-VOTE-IF-TIED? switch is on. How is the result different?

Watch what happens when only the AWARD-CLOSE-CALLS-TO-LOSER? switch is on. How is the result different?

What happens when both switches are on?

EXTENDING THE MODEL

Try other voting rules.

Start with a nonrandom green-and-blue pattern. For example, one could make half of the world blue and half green.

Can you enhance the model to incorporate multiple colors and multiple votes? One might interpret shades of color to represent the degree of a patch's opinion about an issue: strongly against, against, neutral, etc. Each patch could have more than two choices and weighted votes: blue patches' vote could count twice, etc.

RELATED MODELS

Ising (a physics model, but the rules are very similar)

CREDITS AND REFERENCES

This model is described in Rudy Rucker's "Artificial Life Lab", published in 1993 by Waite Group Press.

HOW TO CITE

If you mention this model in a publication, we ask that you include these citations for the model itself and for the NetLogo software:

  • Wilensky, U. (1998). NetLogo Voting model. http://ccl.northwestern.edu/netlogo/models/Voting. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL.
  • Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL.

COPYRIGHT AND LICENSE

Copyright 1998 Uri Wilensky.

CC BY-NC-SA 3.0

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.

This model was created as part of the project: CONNECTED MATHEMATICS: MAKING SENSE OF COMPLEX PHENOMENA THROUGH BUILDING OBJECT-BASED PARALLEL MODELS (OBPML). The project gratefully acknowledges the support of the National Science Foundation (Applications of Advanced Technologies Program) -- grant numbers RED #9552950 and REC #9632612.

This model was converted to NetLogo as part of the projects: PARTICIPATORY SIMULATIONS: NETWORK-BASED DESIGN FOR SYSTEMS LEARNING IN CLASSROOMS and/or INTEGRATED SIMULATION AND MODELING ENVIRONMENT. The project gratefully acknowledges the support of the National Science Foundation (REPP & ROLE programs) -- grant numbers REC #9814682 and REC-0126227. Converted from StarLogoT to NetLogo, 2001.

Comments and Questions

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

Click to Run Model

patches-own
[
  vote         ;; my vote ("blue" or "red")
  gender       ;; my gender
  neighbors-b  ;; list of neighbors around me that voted blue
  neighbors-r  ;; list of neighbors around me that voted red
  total-b      ;; total count of neighbors voting blue
  total-r      ;; total count of neighbors voting red
  gender-b     ;; total count of neighbors with my gender voting blue
  gender-r     ;; total count of neighbors with my gender voting red
]

to setup
  clear-all
  ask patches
    [ ifelse random 100 <= init-%-blue    ;; distribute initial votes
      [ set vote "blue" ]
      [ set vote "red" ]
      ifelse random 100 <= init-%-male    ;; distribute initial gender
      [ set gender "male" ]
      [ set gender "female" ]
      recolor-patch ]
  reset-ticks
end 

to go
  ask patches
    [ set neighbors-b (neighbors with [vote = "blue"])
      set neighbors-r (neighbors with [vote = "red"]) 
      set total-b count neighbors-b
      set total-r count neighbors-r
      set gender-b count neighbors-b with [gender = [gender] of myself]    ;; count neighbors with gender same as me
      set gender-r count neighbors-r with [gender = [gender] of myself] ]
  ;; use two ask patches blocks so all patches compute all "totals"
  ;; before any patches change their votes
  ask patches 
    [ if vote-method = "total"
      [ if total-b > total-r   ;; if more neighbors voting blue
        [ set vote "blue" ]    ;; set vote to blue
        if total-b < total-r   ;; if more neighbors are voting red
        [ set vote "red" ] ]   ;; set vote to red
                               ;; do nothing if it is a tie
      if vote-method = "gender-only"   ;; look at total neighbor votes that match my gender
      [ if gender-b > gender-r
        [ set vote "blue" ]
        if gender-b < gender-r
        [ set vote "red" ] ]
      
      if vote-method = "gender-weighted"  ;; look at total, but weigh votes by neighbors with the same gender
      [ if (total-b - gender-b) + gender-b * 1.2 > (total-r - gender-r) + gender-r * 1.2
        [ set vote "blue" ]
        if (total-b - gender-b) + gender-b * 1.2 < (total-r - gender-r) + gender-r * 1.2
        [ set vote "red" ] ]
      
      recolor-patch ]
    
  tick
end 

to recolor-patch  ;; patch procedure
  ifelse vote = "red"          ;; if red 
    [ ifelse gender = "male"   ;; if male
      [ set pcolor red]        ;; set color red
      [ set pcolor pink] ]     ;; else set color pink
    [ ifelse gender = "male"   ;; if you're not red, you're blue, but are you male?
      [ set pcolor blue ]       ;; if yes, set color blue
      [ set pcolor sky ] ]      ;; else set color sky
end 


; Copyright 1998 Uri Wilensky.
; See Info tab for full copyright and license.

There is only one version of this model, created about 9 years ago by Nathan Holbert.

Attached files

No files

Parent: Voting

This model does not have any descendants.

Graph of models related to 'Voting-Gender'