Final v.0

Final v.0 preview image

1 collaborator

Default-person Noah Conley (Author)

Tags

(This model has yet to be categorized with any tags)
Model group MAM-2013 | Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.0.4 • Viewed 321 times • Downloaded 63 times • Run 0 times
Download the 'Final v.0' 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?

The majority of the material in social psychology rests on the concept of attitude and behavior. Attitudes are feelings or beliefs about different things. Surface attitudes are your favorite movie, least favorite book, etc. They are easily changed, easily affected by others, and easily accessed for basic interactions, especially with people you don't know. Embedded attitudes are things like polictial views, religious beliefs, etc. They are deeply rooted, studies have shown they can even be genetic, they are usually inflexible, and come up in more meaningful interactions. They define who your inner circle of friends are, and how you view strangers at a glance. Embedded attitudes can change, but they don't change the same way as surface attitudes. If someone interacts with a person of a similar attitude with a similar attitude strength, it's likely they will both feel that attitude grow stronger. If two people of very different attitudes interact, it's possible the person with the weaker attitude will be encouraged and grow stronger, or be alienated by the extremeness of the other person, and mvove more neutral. The other person will usually be largely unaffected. When two people of different attitudes interact, they tend to feel more strongly about their own attitude afterwards, but they can also feel more neutral, or change their views to be more similar to the person they were interacting with. There are people who change their attitude very often, but their attitude will be weak, which means they're easily swayed to another view. For the most part, surface attitudes don't matter, so they don't have a huge affect on behavior, but people do have a tendency to meet people and start friendships with people based on surface attitudes. Embedded attitudes definitely have more of an effect on behavior. Often, people spend a majority of their time with people who have similar attitudes to their own, and sometimes even avoid people who have different attitudes. The flip side of the coin is that behavior has an effect on attitude. Spending time with people who have the same embedded attitude can lead to everyone liking the same music or food. Meeting people becuase of surface attitude similarities can lead to more meaningful interactions that affect embedded attitudes. All of this is governed by people's tolerance. Tolerance can change very easily and vary often, even over the course of a day. Tolerance involves how willing a person is to interact with people who don't share their attitudes, and thus how willing they are to consider changing their own attitude because of that interaction. Tolerance isn't universal, between groups or within groups. Certain groups are avoided or accpeted more than others, and certain people within each group are better at branching out than others.

HOW IT WORKS

Surface attitudes are shown using the turtles shape, while embedded attitudes are displayed using the turtles color and size. Basic flocking procedures are used to demonstrate low tolerance, where turtles of similar color group together, with the addition of an avoidance function to avoid turtles who are considered different. The size of the turtles is on a logarithmic scale because larger changes are easier when the attitude is weaker than when they are stronger. Changing size, shape, or color is all based on nested randomness. One random number is chosen at the beginning of the behavior function because at most one action is possible per tick for each turtle. Interactions are simulated by more than one turtle occupying the sme patch, and both have the chance to be affacted. Tolerance affects embedded movement by restricting the movement parameters for flocking. Surface movement is affected by controlling how often the flocking rules are implemented. Higher tolerance, means running the rules almost every time. When the chooser is set to Surface, only surface attitudes are displayed, and only surface behaviors are run. The same goes for when the chooser is set to Embedded. when it's set to Both, both surface and embedded attitudes are displayed, and the turtles movement is affected by both in each move. Turtles first move according to surface rules, then to embedded rules, because the embedded ones are more important. For avoid-minority and avoid-majority, the color with the smallest or largest number of turtles was avoided by running flocking rules as normal to the set tolerance, and then running them again before letting the turtle move, but this time only evauating according to a 0& tolerance to the chosen group.

HOW TO USE IT

setup - setup the model according to the chooser and sliders in the Interface tab go - run the model and update plots display-type - allows user to choose whether they want to observe surface attitudes, embedded attitudes, or both, cna be changed at any time watching turtle - monitor displays the who of the turtle being watched watch a turtle - chooses a random turtle and watches it stop watching - stops watching turtle being watched if there is one possible-surface / possible-embedded - allows the user to limit the maximum possible number of attitudes a turtle can choose from, can be changed at any time population - number of turtles to be present in this run of the model, can only be set once per build tolerance - willingness of each turtle to interact with turtles of different attitudes avoid minority - runs normally, except every turtle not in the smallest group avoids every turtle in the smallest group avoid majority - same as avoid minority, but in respect to the largest group turtles of each embedded attitude - a histogram of all the different possible attitudes in the current build that shows how many turtles are in each group embedded attitude stats - shows the mean and variance of the sizes of all turtles in the model, disabled when size is not a factor, such as when only surface attitudes are being evaluated local area ratio - displays the mean ratio of similar turtles to different turtles in the vicinity of each turtle and the current tolerance level, for context

THINGS TO NOTICE

Run the model in different attitude modes to see how they run separately, then use both to see a more realistic representation of how the concept works. Notice how, over time, the number of groups dwindles, and the range of sizes for embedded attitude gets smaller. Notice how in surface behavior, little groups of turtles of the same shape will align and match each other for a short time, then change and find new partners, whereas in the embedded behavior, two turtles can stay together for an extremely long time if tolerance is low. Notice how the model explodes when in Embedded or Both mode and changing from a low tolerance to a high tolerance. Notice how avoiding the majority or minority affects the size of either group.

THINGS TO TRY

Play around with different population sizes and tolerances, limit the number of possible attitues to chose from, and observe how changing these things affect the ratio of similar to different, the change in the mean size of the turtles, and how quickly a dominant group is found.

EXTENDING THE MODEL

Add a method that makes tolerance unique to each turtle, so they have the option to behave indpendently rather than all act the same way.

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

Flocking

CREDITS AND REFERENCES

Attitudes, Behavior, and Social Context: The Role of Norms and Group Membership edited by Deborah J. Terry, Michael A. Hogg

Gilovich, T., Keltner, D., Chen, S., & Nisbett, R. E.. (2012). Social Psychology (3rd ed.). New York: Norton.

Comments and Questions

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

Click to Run Model

globals [
  minimum-separation
  max-separate-turn
  max-align-turn
  max-cohere-turn
  max-avoid-turn
  vision
  current-tolerance
  current-watch
]

turtles-own [
  surface-attitude
  embedded-attitude
  embedded-strength
  surface-similars
  nearest-surface-similar
  surface-differents
  nearest-surface-different
  embedded-similars
  nearest-embedded-similar
  embedded-differents
  nearest-embedded-different
  tolerance-ratio
]

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; setup
;; sets up all the parameters and turtles for the model.  sets up the 
;; variables that aren't currently in use, but may become active later.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to setup
  ca
  crt population [
    setxy random-xcor random-ycor
    if display-type = "Surface"
    [
      set size 3
      ifelse possible-surface = 38
      [ set shape one-of shapes ]
      [ set shape one-of sublist shapes 0 possible-surface ]
      set surface-attitude shape
      if possible-embedded < 14
      [ set color one-of sublist base-colors 0 possible-embedded ]
      set embedded-attitude color
      set embedded-strength 1 / e ^ (15 / 4) + random-float e ^ (25 / 4)
      set tolerance-ratio 0
    ]
    if display-type = "Embedded"
    [
      set embedded-strength 1 / e ^ (15 / 4) + random-float e ^ (25 / 4)
      set size .4 * ln embedded-strength + 2.5
      set shape "circle"
      if possible-embedded < 14
      [ set color one-of sublist base-colors 0 possible-embedded ]
      set embedded-attitude color
      ifelse possible-surface = 38
      [ set surface-attitude one-of shapes ]
      [ set surface-attitude one-of sublist shapes 0 possible-surface ]
      set tolerance-ratio 0
    ]
    if display-type = "Both"
    [
      set embedded-strength 1 / e ^ (15 / 4) + random-float e ^ (25 / 4)
      set size .4 * ln embedded-strength + 2.5
      ifelse possible-surface = 38
      [ set shape one-of shapes ]
      [ set shape one-of sublist shapes 0 possible-surface ]
      if possible-embedded < 14
      [ set color one-of sublist base-colors 0 possible-embedded ]
      set embedded-attitude color
      set surface-attitude shape
      set tolerance-ratio 0
    ]
  ]
  
  ;; flocking details set based on current tolerance level
  set current-tolerance tolerance
  set minimum-separation (current-tolerance / 20 + 3)
  set max-align-turn ((100 - current-tolerance) / 5)
  set max-separate-turn (current-tolerance / 5)
  set max-cohere-turn ((100 - current-tolerance) / 5)
  set max-avoid-turn ((100 - current-tolerance) / 5)
  
  set vision 10
  
  set current-watch "" ;; turtle being watched (none at beginning)
  
  reset-ticks
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; go
;; default way to run the model.  modifies the tolerance if there's a change,
;; gives orders to the turtles based on the current display state.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to go
  if current-tolerance != tolerance
  [
    set current-tolerance tolerance
    set minimum-separation (current-tolerance / 20 + 6)
    set max-align-turn ((100 - current-tolerance) / 5)
    set max-separate-turn (current-tolerance / 5)
    set max-cohere-turn ((100 - current-tolerance) / 5)
    set max-avoid-turn ((100 - current-tolerance) / 5)
  ]
  ask turtles
  [
    if display-type = "Surface" 
    [ 
      surface-behavior
      surface-movement
    ]
    if display-type = "Embedded"
    [
      embedded-behavior
      embedded-movement
    ]
    if display-type = "Both"
    [
      embedded-behavior
      surface-behavior
      combined-movement
    ]
  ]
  repeat 5 [ ask turtles [ fd .1 ] display ]
  plot-ratio 
  tick
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; avoid-minority
;; makes a list of all turtles based on color and singles out those in the
;; smallest gorup.  tells the other turtles to behave normally towards each
;; other, but avoid the smallest group with 0% tolerance.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to avoid-minority
  let smallest first first sort-by [last ?1 < last ?2] filter [last ? > 0] n-values 140 [ (list ? count turtles with [ color = ? ] )]
  if current-tolerance != tolerance
  [
    set current-tolerance tolerance
    set minimum-separation (current-tolerance / 20 + 6)
    set max-align-turn ((100 - current-tolerance) / 5)
    set max-separate-turn (current-tolerance / 5)
    set max-cohere-turn ((100 - current-tolerance) / 5)
    set max-avoid-turn ((100 - current-tolerance) / 5)
  ]
  ask turtles
  [
    if display-type = "Surface" 
    [ 
      surface-behavior
      surface-movement
    ]
    if display-type = "Embedded"
    [
      embedded-behavior
      embedded-movement
    ]
    if display-type = "Both"
    [
      embedded-behavior
      surface-behavior
      combined-movement
    ]
  ]
  
  ask turtles with [color != smallest]
  [
    set current-tolerance 0
    set minimum-separation (current-tolerance / 20 + 6)
    set max-align-turn ((100 - current-tolerance) / 5)
    set max-separate-turn (current-tolerance / 5)
    set max-cohere-turn ((100 - current-tolerance) / 5)
    set max-avoid-turn ((100 - current-tolerance) / 5)
    if display-type = "Embedded"
    [
      if any? embedded-differents
      [
        set embedded-differents embedded-differents with [color = smallest]
        if any? embedded-differents
        [
          find-nearest-embedded-different
          if distance nearest-embedded-different < minimum-separation * 2
          [ avoid-embedded ]
        ]
      ]
    ]
    if display-type = "Both"
    [
      if any? embedded-differents
      [
        set embedded-differents embedded-differents with [color = smallest]
        if any? embedded-differents
        [
          find-nearest-embedded-different
          if distance nearest-embedded-different < minimum-separation * 2
          [ avoid-embedded ]
        ]
      ]
    ]
  ]
  repeat 5 [ ask turtles [ fd .1 ] display ]
  plot-ratio
  tick
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; avoid-majority
;; makes a list of all turtles based on color and singles out those in the
;; largest gorup.  tells the other turtles to behave normally towards each
;; other, but avoid the largest group with 0% tolerance.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to avoid-majority
  let largest first first sort-by [last ?1 > last ?2] filter [last ? > 0] n-values 140 [ (list ? count turtles with [ color = ? ] )]
  if current-tolerance != tolerance
  [
    set current-tolerance tolerance
    set minimum-separation (tolerance / 20 + 6)
    set max-align-turn ((100 - current-tolerance) / 5)
    set max-separate-turn (tolerance / 5)
    set max-cohere-turn ((100 - current-tolerance) / 5)
    set max-avoid-turn ((100 - current-tolerance) / 5)
    set vision 10
  ]
  ask turtles
  [
    if display-type = "Surface" 
    [ 
      surface-behavior
      surface-movement
    ]
    if display-type = "Embedded"
    [
      embedded-behavior
      embedded-movement
    ]
    if display-type = "Both"
    [
      embedded-behavior
      surface-behavior
      combined-movement
    ]
  ]
  
  ask turtles with [color != largest]
  [
    set current-tolerance 0
    set minimum-separation (current-tolerance / 20 + 6)
    set max-align-turn ((100 - current-tolerance) / 5)
    set max-separate-turn (current-tolerance / 5)
    set max-cohere-turn ((100 - current-tolerance) / 5)
    set max-avoid-turn ((100 - current-tolerance) / 5)
    if display-type = "Embedded"
    [
      if any? embedded-differents
      [
        set embedded-differents embedded-differents with [color = largest]
        if any? embedded-differents
        [
          find-nearest-embedded-different
          if distance nearest-embedded-different < minimum-separation * 2
          [ avoid-embedded ]
        ]
      ]
    ]
    if display-type = "Both"
    [
      if any? embedded-differents
      [
        set embedded-differents embedded-differents with [color = largest]
        if any? embedded-differents
        [
          find-nearest-embedded-different
          if distance nearest-embedded-different < minimum-separation * 2
          [ avoid-embedded ]
        ]
      ]
    ]
  ]
  repeat 5 [ ask turtles [ fd .1 ] display ]
  plot-ratio
  tick
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; surface-behavior
;; controls how the turtles behave in Surface mode.  they only keep track of
;; their surface attitude, represented by shape.  they have the chance to
;; randomly change on their own, or if they share a patch with a turtle of a
;; different shape, they have the chance to copy their surface attitude
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to surface-behavior
  let x random 100
  ifelse count other turtles-here != 0 and [surface-attitude] of one-of other turtles-here != [surface-attitude] of self
  [ 
    ifelse x < 10 [
      set surface-attitude [surface-attitude] of one-of other turtles-here
    ]
    [ 
      if x < 15
      [  
        ifelse possible-surface = 38
        [ set surface-attitude one-of shapes ]
        [ set surface-attitude one-of sublist shapes 0 possible-surface ]
      ]
    ]
  ]
  [ 
    if x < 55
    [  
      ifelse possible-surface = 38
      [ set surface-attitude one-of shapes ]
      [ set surface-attitude one-of sublist shapes 0 possible-surface ]
    ]
  ]
  set shape surface-attitude
  if display-type = "Surface" [ set size 3 ]
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; embedded-behavior
;; controls how the turtles behave in Embedded mode.  they only keep track of
;; their embedded attitude, represented by size and color.  they change based
;; on random interaction with other turtles.  they grow, shrink, or change
;; color based on chance and the color and size of the turtle they're with.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to embedded-behavior
  if count other turtles-here != 0
  [
    let t one-of other turtles-here
    let x random 100
    ifelse [embedded-attitude] of t = [embedded-attitude] of self
    [
      ifelse [size] of t - [size] of self > 2
      [
        ifelse x < 5
        [ set embedded-strength embedded-strength - .2 ]
        [
          if x < 10
          [ set embedded-strength embedded-strength + .1 ]
        ]
      ]
      [ if x < 5
        [ set embedded-strength embedded-strength + .1 ]
      ]
    ]
    [ 
      ifelse abs ([embedded-attitude] of self - [embedded-attitude] of t) < current-tolerance / 10
      [
        ifelse x < 5
        [
          set embedded-attitude [embedded-attitude] of t
          set embedded-strength embedded-strength + .4 * -1 ^ random 1
        ]
        [ 
          if x < 25
          [ set embedded-strength embedded-strength + .2 * -1 ^ random 1 ]
        ]
      ]
      [
        ifelse size < 2
        [
          ifelse x < 5
          [
            set embedded-attitude [embedded-attitude] of t
            set embedded-strength embedded-strength + .2
          ]
          [
            ifelse x < 20 [ set embedded-strength embedded-strength + .1 ] 
            [ if x < 42 [ set embedded-strength embedded-strength - .2 ] ] 
          ]
        ]
        [
          ifelse x < 1
          [
            set embedded-attitude [embedded-attitude] of t
            set embedded-strength embedded-strength + .8 * -1 ^ random 1
          ]
          [
            ifelse x < 31
            [
              set embedded-strength embedded-strength + .1
            ]
            [
              if x < 1 [ set embedded-strength embedded-strength - .4 ]
            ]
          ]
        ]
      ]
    ]
  ]
  
  if is-agentset? embedded-similars and is-agentset? embedded-differents and count embedded-differents != 0
  [ set tolerance-ratio count embedded-similars / count embedded-differents ]
  
  if embedded-strength < 1 / e ^ 4 [ set embedded-strength 1 / e ^ 4 ]
  if embedded-strength > e ^ 12 [ set embedded-strength e ^ 12 ]
  if display-type = "Embedded" [ set shape "circle" ]
  set size  .4 * ln embedded-strength + 2.5
  set color embedded-attitude
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; surface-movement
;; controls how the turtles move in Surface mode.  normally they move in a
;; straight line, but as tolerance gets lower, the chance that they will
;; follow flocking rules increases
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to surface-movement
  if random 100 < 100 - current-tolerance
  [
    find-surface-similars
    if any? surface-similars
    [ 
      find-nearest-surface-similar
      ifelse distance nearest-surface-similar < minimum-separation
      [ separate-surface ]
      [ 
        align-surface
        cohere-surface
      ]
    ]
  ]
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; embedded-movement
;; controls how the turtles move in Embedded mode.  turtles are always
;; affected by tolerance, but the flocking rules become more relaxed as level
;; of tolerance increases.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to embedded-movement
  find-embedded-similars
  if any? embedded-similars
  [ 
    find-nearest-embedded-similar
    ifelse distance nearest-embedded-similar < minimum-separation
    [ separate-embedded ]
    [ 
      align-embedded
      cohere-embedded
    ]
  ]
  
  find-embedded-differents
  if any? embedded-differents
  [
    find-nearest-embedded-different
    if distance nearest-embedded-different < minimum-separation * 2
    [ avoid-embedded ]
  ]
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; combined-movement
;; controls how the turtles move in Both mode.  surface and embedded behavior
;; are present, so rules for both modes are followed simultaneously.
;; surface rules are evaluated first because they are less important.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to combined-movement
  if random 100 < 100 - current-tolerance
  [
    find-surface-similars
    if any? surface-similars
    [ 
      find-nearest-surface-similar
      ifelse distance nearest-surface-similar < minimum-separation
      [ separate-surface ]
      [ 
        align-surface
        cohere-surface
      ]
    ]
  ]
  
  find-embedded-similars
  if any? embedded-similars
  [ 
    find-nearest-embedded-similar
    ifelse distance nearest-embedded-similar < minimum-separation
    [ separate-embedded ]
    [ 
      align-embedded
      cohere-embedded
    ]
  ]
  
  find-embedded-differents
  if any? embedded-differents
  [
    find-nearest-embedded-different
    if distance nearest-embedded-different < minimum-separation * 2
    [ avoid-embedded ]
  ]
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; flocking rules
;; there are two compies of almost every method below, one for surface, one
;; for embedded.  there are some differences, such as how turtles don't care
;; about finding turtles with different surface attitudes from themsevles,
;; because surface attitudes are more specific and diverse than embedded
;; attitudes.  Most of these are similar to the functions in the focking
;; model in the models library, the biggest difference is finding differents
;; and avoiding those differents.  These funcitons are similar to separating
;; from similars
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to find-surface-similars
  set surface-similars other turtles with [surface-attitude = [surface-attitude] of myself] in-radius vision
end 

to find-embedded-similars
  set embedded-similars other turtles with
  [
    color - current-tolerance / 10 < [color] of myself and color + current-tolerance / 10 > [color] of myself
  ]
  in-radius vision
end 

to find-embedded-differents
  set embedded-differents other turtles with
  [
    color - current-tolerance / 10 < [color] of myself and color + current-tolerance / 10 < [color] of myself
  ]
  in-radius vision
end 

to find-nearest-surface-similar
  set nearest-surface-similar min-one-of surface-similars [distance myself]
end 

to find-nearest-embedded-similar
  set nearest-embedded-similar min-one-of embedded-similars [distance myself]
end 

to find-nearest-embedded-different
  set nearest-embedded-different min-one-of embedded-differents [distance myself]
end 

to separate-surface
  turn-away ([heading] of nearest-surface-similar) max-separate-turn
end 

to separate-embedded
  turn-away ([heading] of nearest-embedded-similar) max-separate-turn
end 

to avoid-embedded
  turn-away ([heading] of nearest-embedded-different) max-avoid-turn
end 

to align-surface
  turn-towards average-similar-surface-heading max-align-turn
end 

to align-embedded
  turn-towards average-similar-embedded-heading max-align-turn
end 

to-report average-similar-surface-heading
  let x-component sum [dx] of surface-similars
  let y-component sum [dy] of surface-similars
  ifelse x-component = 0 and y-component = 0
    [ report heading ]
    [ report atan x-component y-component ]
end  

to-report average-similar-embedded-heading
  let x-component sum [dx] of embedded-similars
  let y-component sum [dy] of embedded-similars
  ifelse x-component = 0 and y-component = 0
    [ report heading ]
    [ report atan x-component y-component ]
end  

to cohere-surface
  turn-towards average-heading-towards-surface-similars max-cohere-turn
end 

to cohere-embedded
  turn-towards average-heading-towards-embedded-similars max-cohere-turn
end 

to-report average-heading-towards-surface-similars
  let x-component mean [sin (towards myself + 180)] of surface-similars
  let y-component mean [cos (towards myself + 180)] of surface-similars
  ifelse x-component = 0 and y-component = 0
    [ report heading ]
    [ report atan x-component y-component ]
end 

to-report average-heading-towards-embedded-similars
  let x-component mean [sin (towards myself + 180)] of embedded-similars
  let y-component mean [cos (towards myself + 180)] of embedded-similars
  ifelse x-component = 0 and y-component = 0
    [ report heading ]
    [ report atan x-component y-component ]
end  

to turn-towards [new-heading max-turn]
  turn-at-most (subtract-headings new-heading heading) max-turn
end  

to turn-away [new-heading max-turn]
  turn-at-most (subtract-headings heading new-heading) max-turn
end  

to turn-at-most [turn max-turn]
  ifelse abs turn > max-turn
    [ ifelse turn > 0
        [ rt max-turn ]
        [ lt max-turn ] ]
    [ rt turn ]
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; plot-ratio
;; plots the ratio of similars to differents the turtles observe when on
;; Embedded or Both mode
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to plot-ratio
  set-current-plot "local area ratio"
  let x 0
  ask turtles
  [ set x x + tolerance-ratio ]
  plot x / population
end 

There are 7 versions of this model.

Uploaded by When Description Download
Noah Conley about 12 years ago Attitude and Behavior Download this version
Noah Conley about 12 years ago Attitudes and Behavior Download this version
Noah Conley about 12 years ago Attitudes and Behavior Download this version
Noah Conley about 12 years ago Attitudes and Behavior Download this version
Noah Conley over 12 years ago Version 2 Download this version
Noah Conley over 12 years ago v.1.0 Download this version
Noah Conley over 12 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Final v.0.png preview Preview image about 12 years ago, by Noah Conley Download
NoahConley_Design_Proposal.pdf word Initial Design Proposal over 12 years ago, by Noah Conley Download
NoahConley_Progress_Report_1.pdf word Progress Report 1 over 12 years ago, by Noah Conley Download
NoahConley_Progress_Report_2.pdf word Progress Report 2 over 12 years ago, by Noah Conley Download
NoahConley_Progress_Report_3.pdf word Progress Report 3 over 12 years ago, by Noah Conley Download
NoahConley_Progress_Report_4.pdf word Progress Report 4 over 12 years ago, by Noah Conley Download

This model does not have any ancestors.

This model does not have any descendants.