Election campaign simulator
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
patches-own [ ;; to define the attribute of the agents legit ] to setup ;; to set up the system clear-all ;; clears the system to create another ask patches [ ;; the patches represent voters set legit random-float 1 ;; Legit represents the attribute legitimacy preference. ifelse (legit <= 0.5) [ ;; if legit value is less than or equal to 0.5, the agent is colored red. set pcolor red ] [ set pcolor blue ] ;; if legit value is greater than or equal to 0.5, the agent is colored blue. ] end to campaign ;; the agents will try to convert their neighbors. Meanwhile, every agent will also be converted by their neighbors. ask patches [ let current-patch self ask current-patch [ ifelse ( legit <= 0.5 ) [ ;; if legit is less than 0.5, the agent is red and will ask its neighbor to become one by diminishing their legit value by 0.5. This process simulates the way neighbors try to discredit candidates to convert their supporters. ask neighbors [ set legit (legit - 0.5)]] ;; If legit value is greater than 0.5, the agent is blue and will ask neighbors to become one by adding 0.5 to their legit value. [ ask neighbors [ set legit (legit + 0.5)]] ifelse (legit <= 0.5) [ set pcolor red ] [ set pcolor blue ] ;; Agents change color based on the value of legit ]] end
There is only one version of this model, created over 9 years ago by CJ Castillo.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
Election campaign simulator.png | preview | Preview for 'Election campaign simulator' | over 9 years ago, by CJ Castillo | Download |
This model does not have any ancestors.
This model does not have any descendants.