Prejudice

No preview image

1 collaborator

Default-person Alexander Risman (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 4.1.2 • Viewed 149 times • Downloaded 18 times • Run 0 times
Download the 'Prejudice' 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 [
  leaders
  smith-leaders
  john-leaders
  ]
directed-link-breed [friendships friendship]


breed [smiths smith]
breed [johns john]
turtles-own [
  in-friends
  out-friends
  total-friends
  leader
]

to setup
  clear-all
  crt 100
  ask turtles [
     ifelse random-float 100 <= percent-red
     [set breed smiths]
     [set breed johns]
     move-to one-of patches
     set shape "person"
   ]
   ask smiths
   [set color red]
   ask johns 
   [set color blue]
end    

to go
  
  ask turtles[
  
  set out-friends count out-friendship-neighbors
  set in-friends count in-friendship-neighbors
  let total-friend-set (turtle-set in-friendship-neighbors out-friendship-neighbors)
  set total-friends count total-friend-set
  wiggle
  maintain-max
   
  ]
  
  ask smiths[
    make-friends-smith]
  ask johns[
    make-friends-john]
  tick
end  

to wiggle 
  rt random-float 360 fd 1
end 

to make-friends-smith
 let prospect ifelse-value (random-float 100 < red-prejudice)
 [one-of other smiths-here] 
 [one-of other turtles-here]
  if prospect != nobody
  [
    if out-friends < max-following
  [create-friendship-to prospect]
  if out-friends = max-following
  [let worst-friend min-one-of out-friendship-neighbors [total-friends]
    if worst-friend != nobody
    [
  if [total-friends] of prospect > [total-friends] of worst-friend
  [ask out-friendship-to worst-friend [die] 
    create-friendship-to prospect]]
  ]
  ]
end 

to make-friends-john
 let prospect ifelse-value (random-float 100 < blue-prejudice)
 [one-of other johns-here] 
 [one-of other turtles-here]
  if prospect != nobody
  [
    if out-friends < max-following
  [create-friendship-to prospect]
  if out-friends = max-following
  [let worst-friend min-one-of out-friendship-neighbors [total-friends]
    if worst-friend != nobody
    [
  if [total-friends] of prospect > [total-friends] of worst-friend
  [ask out-friendship-to worst-friend [die] 
    create-friendship-to prospect]]
  ]
  ]
end 

to maintain-max
  let worst-out-friend min-one-of out-friendship-neighbors [total-friends]
  let worst-in-friend  min-one-of in-friendship-neighbors [total-friends]
  if worst-out-friend != nobody
  [
    if out-friends > max-following
  [ask out-friendship-to worst-out-friend [die] ]
  ]
  if worst-in-friend != nobody  
    [if in-friends > max-followed-by
    [ask in-friendship-from worst-in-friend [die] ]
    ]
end 

to update-leaders
  
  let popular-smith-set (turtle-set smiths with [total-friends >= mean [total-friends] of 
      smiths])
  let leader-smith-set (turtle-set smiths with [total-friends >= mean [total-friends] of 
      popular-smith-set])
  let popular-john-set (turtle-set johns with [total-friends >= mean [total-friends] of 
      johns])
  let leader-john-set (turtle-set johns with [total-friends >= mean [total-friends] of 
      popular-john-set])
  let leader-set (turtle-set leader-john-set leader-smith-set)
  set smith-leaders count leader-smith-set
  set john-leaders count leader-john-set
  set leaders count leader-set
end   
  
   





  
      
     

There is only one version of this model, created almost 13 years ago by Alexander Risman.

Attached files

No files

Parent: RismanPreferentialAttachment

This model does not have any descendants.

Graph of models related to 'Prejudice'