Brain for Social Identity Theory Model

No preview image

1 collaborator

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.0-M6 • Viewed 243 times • Downloaded 24 times • Run 0 times
Download the 'Brain for Social Identity Theory Model' 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 [
  levels-dimension1
  levels-dimension2
  levels-dimension3
  a ; useful for iteration
  b
  c
  x
  dimension-dominant-next-child
  overall-importance-list
  overall-max-value
]

breed [Dimension1 Levels1]
breed [Dimension2 Levels2]
breed [Dimension3 Levels3]

turtles-own [
  active       ; whether this level of a given dimension is accurate for a given brain
  social-identification
  num-times-used
  current-salience
  comparative-fit
  normative-fit
  overall-importance
]

links-own [
  link-active        ; whether this link (between active levels) is active for a given brain
  link-num-times-used
  link-social-identification
  link-comparative-fit
  link-normative-fit
  link-overall-importance
  link-current-salience
]

to setup [
          levels-dimension1-fromparent
          levels-dimension2-fromparent
          levels-dimension3-fromparent]
  ca
  set-default-shape turtles "circle"

  set levels-dimension1 levels-dimension1-fromparent
  set levels-dimension2 levels-dimension2-fromparent
  set levels-dimension3 levels-dimension3-fromparent

  ; make all the possible identity nodes (i.e. all the levels for each dimension), using information from the parent model
  create-dim1
  create-dim2
  create-dim3

  ask turtles [
    set comparative-fit 0
    set normative-fit 0
    set num-times-used 0
    set social-identification 0
    set current-salience 0
    set size 1
    set color 3]
  ; create all possible links between turtles, and set them to inactive + grey

  link-all-levels
end 

to create-dim1
  set a 1
  create-Dimension1 levels-dimension1
  ask Dimension1 [
      let y 32 / (levels-dimension1 + 2) * a - 15
      setxy -10 y
      set a a + 1]
end 

to create-dim2
  set a 1
  create-Dimension2 levels-dimension2
  ask Dimension2 [
      let y 32 / (levels-dimension2 + 2) * a - 15
      setxy 0 y
      set a a + 1]
end 

to create-dim3
  set a 1
  create-Dimension3 levels-dimension3
  ask Dimension3 [
      let y 32 / (levels-dimension3 + 2) * a - 15
      setxy 10 y
      set a a + 1]
end 

to link-all-levels
  ask turtles [
    create-links-with other turtles]
  ask links [
    set color 3
    set link-active 0
    set link-social-identification 0
    set link-comparative-fit 0
    set link-normative-fit 0
    set link-overall-importance 0
    set link-current-salience 0]
end 

to activate-levels [
           dim1_level
           dim2_level
           dim3_level
           dimension-dominant]
  ; first, select one level of each identity dimension to be active
  ask Levels1 (dim1_level - 1) [
    set active 1     ; this is the level of this identity that is active for this brain
    set color green]
  ask Levels2 (dim2_level + levels-dimension1 - 1) [
    set active 1
    set color green]
  ask Levels3 (dim3_level + levels-dimension1 + levels-dimension2 - 1) [
    set active 1
    set color green]

  ; now, have the links between the active nodes also be active
  ask links [if ([active] of end1 = 1) and ([active] of end2 = 1) [
    set link-active 1
    set color green]]

  ;now, assign one instance of enacting the identity to the "dimension-dominant" identity for this agent in the parent model
  if dimension-dominant = 1 [
    ask Dimension1 with [active = 1] [set num-times-used 1]]
  if dimension-dominant = 2 [
    ask Dimension2 with [active = 1] [set num-times-used 1]]
  if dimension-dominant = 3 [
    ask Dimension3 with [active = 1] [set num-times-used 1]]

  ; if intersectionality is a thing, assign dominance to the right link
  if dimension-dominant = 12 [
      ask links with [(link-active = 1 and (([breed] of [end1] of self = Dimension1 and [breed] of [end2] of self = Dimension2) or ([breed] of [end1] of self = Dimension2 and [breed] of [end2] of self = Dimension1)))] [
        set link-num-times-used 1]]
  if dimension-dominant = 23 [
      ask links with [(link-active = 1 and (([breed] of [end1] of self = Dimension2 and [breed] of [end2] of self = Dimension3) or ([breed] of [end1] of self = Dimension3 and [breed] of [end2] of self = Dimension2)))] [
        set link-num-times-used 1]]
  if dimension-dominant = 13 [
      ask links with [(link-active = 1 and (([breed] of [end1] of self = Dimension1 and [breed] of [end2] of self = Dimension3) or ([breed] of [end1] of self = Dimension3 and [breed] of [end2] of self = Dimension1)))] [
        set link-num-times-used 1]]
end 

to gather-salience [
         dim1-salience-from-context
         dim2-salience-from-context
         dim3-salience-from-context
         intersectionality]
    ; these are standardized to be a # that is % of total salience
    ask Dimension1 [set current-salience item ([WHO] of self) dim1-salience-from-context]
    ask Dimension2 [set current-salience item ([WHO] of self - levels-dimension1) dim2-salience-from-context]
    ask Dimension3 [set current-salience item ([WHO] of self - levels-dimension1 - levels-dimension2) dim3-salience-from-context]
    if intersectionality = 1 [
      ask links [set link-current-salience (([[current-salience] of end1] of self + [[current-salience] of end2] of self) / 2)]
    ]
end 

to define-comparative-fit [
          sharedlevel-distance-cat1
          sharedlevel-distance-cat2
          sharedlevel-distance-cat3
          notsharedlevel-distance-cat1
          notsharedlevel-distance-cat2
          notsharedlevel-distance-cat3
          sharedlevel-distance-intersection12
          sharedlevel-distance-intersection23
          sharedlevel-distance-intersection13
          notsharedlevel-distance-intersection12
          notsharedlevel-distance-intersection23
          notsharedlevel-distance-intersection13
          intersectionality]
  ; these are set to be numbers that are % of total possible comparative fit
  ask Dimension1 with [active = 1] [set comparative-fit round((notsharedlevel-distance-cat1 / sharedlevel-distance-cat1) * 10)]
  ask Dimension2 with [active = 1] [set comparative-fit round((notsharedlevel-distance-cat2 / sharedlevel-distance-cat2) * 10)]
  ask Dimension3 with [active = 1] [set comparative-fit round((notsharedlevel-distance-cat3 / sharedlevel-distance-cat3) * 10)]
  if intersectionality = 1 [
    ask activelink-intersection12 [set link-comparative-fit round((notsharedlevel-distance-intersection12 / sharedlevel-distance-intersection12) * 10)]
    ask activelink-intersection23 [set link-comparative-fit round((notsharedlevel-distance-intersection23 / sharedlevel-distance-intersection23) * 10)]
    ask activelink-intersection13 [set link-comparative-fit round((notsharedlevel-distance-intersection13 / sharedlevel-distance-intersection13) * 10)]]
end 

to define-normative-fit [
           normative-fit-cat1
           normative-fit-cat2
           normative-fit-cat3
           normative-fit-intersection12
           normative-fit-intersection23
           normative-fit-intersection13
           intersectionality]
  ; these are set to be numbers that are a % of total possible normative fit
  ask Dimension1 with [active = 1] [set normative-fit normative-fit-cat1]
  ask Dimension2 with [active = 1] [set normative-fit normative-fit-cat2]
  ask Dimension3 with [active = 1] [set normative-fit normative-fit-cat3]
  if intersectionality = 1 [
    ask activelink-intersection12 [set link-normative-fit normative-fit-intersection12]
    ask activelink-intersection23 [set link-normative-fit normative-fit-intersection23]
    ask activelink-intersection13 [set link-normative-fit normative-fit-intersection13]
  ]
end 

to determine-next-dimension [
             weight1
             weight2
             weight3
             weight4
             intersectionality
             dimension-dominant]
  ; have each active node determine how important it is, according to the weights of the four calculated measures
  ifelse (weight1 + weight2 + weight3 + weight4) != 0 [
    ask turtles with [active = 1] [
      set overall-importance ((normative-fit * weight1) + (comparative-fit * weight2) + (current-salience * weight3) + (social-identification * weight4))
      set size overall-importance / ( 25 * (weight1 + weight2 + weight3 + weight4))] ; scaling to make it pretty
    ifelse intersectionality = 1 [
      ask links with [link-active = 1][
        set link-overall-importance ((link-normative-fit * weight1) + (link-comparative-fit * weight2) + (link-current-salience * weight3) + (link-social-identification * weight4))
        set thickness (link-overall-importance / (weight1 + weight2 + weight3 + weight4)) / 200] ; scaling to make it pretty
      set overall-importance-list (list
        ([overall-importance] of Dimension1 with [active = 1])
        ([overall-importance] of Dimension2 with [active = 1])
        ([overall-importance] of Dimension3 with [active = 1])
        ([link-overall-importance] of activelink-intersection13)
        ([link-overall-importance] of activelink-intersection12)
        ([link-overall-importance] of activelink-intersection23))
      set overall-max-value max flatten-list overall-importance-list
      if position overall-max-value flatten-list overall-importance-list = 0 [
        set dimension-dominant-next-child 1]
      if position overall-max-value flatten-list overall-importance-list = 1 [
        set dimension-dominant-next-child 2]
      if position overall-max-value flatten-list overall-importance-list = 2 [
        set dimension-dominant-next-child 3]
      if position overall-max-value flatten-list overall-importance-list = 3 [
        set dimension-dominant-next-child 13]
      if position overall-max-value flatten-list overall-importance-list = 4 [
        set dimension-dominant-next-child 12]
      if position overall-max-value flatten-list overall-importance-list = 5 [
        set dimension-dominant-next-child 23]]
    [
      set overall-importance-list (list ([overall-importance] of Dimension1 with [active = 1]) ([overall-importance] of Dimension2 with [active = 1]) ([overall-importance] of Dimension3 with [active = 1]))
      set overall-max-value max flatten-list overall-importance-list
      if position overall-max-value flatten-list overall-importance-list = 0 [
        set dimension-dominant-next-child 1]
      if position overall-max-value flatten-list overall-importance-list = 1 [
        set dimension-dominant-next-child 2]
      if position overall-max-value flatten-list overall-importance-list = 2 [
        set dimension-dominant-next-child 3]]]
  [ set dimension-dominant-next-child dimension-dominant]
end 

to set-social-identification [
            number-of-ticks
            dimension-dominant
            intersectionality]
  if dimension-dominant = 1 [
    ask Dimension1 with [active = 1] [
      set num-times-used num-times-used + 1]]
  if dimension-dominant = 2 [
    ask Dimension2 with [active = 1] [
      set num-times-used num-times-used + 1]]
  if dimension-dominant = 3 [
    ask Dimension3 with [active = 1] [
      set num-times-used num-times-used + 1]]
  ask turtles with [active = 1] [set social-identification round((num-times-used / (number-of-ticks + 1)) * 100) ] ; social identification is the % of the total ticks that this has been used
  if intersectionality = 1 [
    if dimension-dominant = 12 [
      ask activelink-intersection12 [set link-num-times-used link-num-times-used + 1]]
    if dimension-dominant = 23 [
      ask activelink-intersection23 [set link-num-times-used link-num-times-used + 1]]
    if dimension-dominant = 13 [
      ask activelink-intersection13 [set link-num-times-used link-num-times-used + 1]]
    ask links with [link-active = 1] [set link-social-identification round((link-num-times-used / (number-of-ticks + 1)) * 100) ]
  ]
end 

to-report activelink-intersection12
  report links with [(link-active = 1) and (([breed] of end1 = Dimension1 and [breed] of end2 = Dimension2) or ([breed] of end1 = Dimension2 and [breed] of end2 = Dimension1))]
end 

to-report activelink-intersection23
  report links with [(link-active = 1) and (([breed] of end1 = Dimension2 and [breed] of end2 = Dimension3) or ([breed] of end1 = Dimension3 and [breed] of end2 = Dimension2))]
end 

to-report activelink-intersection13
  report links with [(link-active = 1) and (([breed] of end1 = Dimension1 and [breed] of end2 = Dimension3) or ([breed] of end1 = Dimension3 and [breed] of end2 = Dimension1))]
end 

to-report flatten-list [ #lst ]
   ; flattens nested lists to a single list. Embellishes on "sentence" in that [[1 2] [3 4]] is
   ; flattened to [1 2 3 4] rather than being unaffected as sentence will do.
   ; if lst contains a list, flatten it and then call flatten-list again in case there were sublists.
   ; otherwise, just return lst.
   if (reduce [?1 or is-list? ?2] fput false #lst) [
     set #lst reduce [sentence ?1 ?2] #lst
     set #lst flatten-list #lst
   ]
   report #lst
end 

There is only one version of this model, created almost 8 years ago by Natalie Gallagher.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.