Contact Hypothesis Model

Contact Hypothesis Model preview image

1 collaborator

Charis_psaltis_photo Charis Psaltis (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.3.0 • Viewed 1065 times • Downloaded 13 times • Run 0 times
Download the 'Contact Hypothesis 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 [
]

breed [ group-a-members group-a-member ]
breed [ group-b-members group-b-member ]

group-a-members-own [ crossing-allowed? prejudice ]
group-b-members-own [ crossing-allowed? prejudice ]

to setup
  clear-all

  ; Draw the horizontal line
  ask patches with [pycor = 0] [ set pcolor green ]

  create-group-a-members group-a-size [
    set color gray
    set shape "person"
    set size 1.5
    set crossing-allowed? (random-float 1 <= percentage-a-cross)
    set prejudice 1 + random 10
    setxy random-xcor (min-pycor + 1 + random (abs 0 - min-pycor - 1))
  ]
  create-group-b-members group-b-size [
    set color orange
    set shape "person"
    set size 1.5
    set crossing-allowed? (random-float 1 <= percentage-b-cross)
    set prejudice 1 + random 10
    setxy random-xcor (1 + random (abs max-pycor - 1))
  ]
  reset-ticks
end 

to update-plot [mean-prejudice-a mean-prejudice-b]
  set-current-plot "Mean Prejudice Levels"
  set-current-plot-pen "group-a"
  plot mean-prejudice-a

  set-current-plot-pen "group-b"
  plot mean-prejudice-b
end 

to go
  ask turtles [
    move
    interact
  ]

  let mean-prejudice-a mean [prejudice] of group-a-members
  let mean-prejudice-b mean [prejudice] of group-b-members

  update-plot mean-prejudice-a mean-prejudice-b

  tick
end 

to move
  let old-xcor xcor
  let old-ycor ycor

  rt random 50 - 25
  if can-move? 1 [
    fd 1
  ]

  ifelse breed = group-a-members [
    if ycor >= 0 and not crossing-allowed? [
      setxy old-xcor old-ycor
    ]
  ] [
    if ycor <= 0 and not crossing-allowed? [
      setxy old-xcor old-ycor
    ]
  ]
end 

to interact
  let other-turtle one-of other turtles-here
  if other-turtle != nobody [
    ifelse breed = group-a-members [
      if [breed] of other-turtle = group-b-members [
        if prejudice < interaction-threshold [
          set prejudice prejudice - (prejudice * prejudice-reduction-factor)
          ask other-turtle [ set prejudice prejudice - (prejudice * prejudice-reduction-factor) ]
        ]
      ]
    ] [
      if [breed] of other-turtle = group-a-members [
        if prejudice < interaction-threshold [
          set prejudice prejudice - (prejudice * prejudice-reduction-factor)
          ask other-turtle [ set prejudice prejudice - (prejudice * prejudice-reduction-factor) ]
        ]
      ]
    ]
  ]
end 




There is only one version of this model, created over 1 year ago by Charis Psaltis.

Attached files

File Type Description Last updated
Contact Hypothesis Model.png preview Preview of Interface over 1 year ago, by Charis Psaltis Download

This model does not have any ancestors.

This model does not have any descendants.