Emotional contagion in metro emergencies

Emotional contagion in metro emergencies preview image

1 collaborator

Default-person Ying Zhang (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.4.0 • Viewed 177 times • Downloaded 24 times • Run 0 times
Download the 'Emotional contagion in metro emergencies' 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?

(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

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

Click to Run Model

turtles-own [emotion appraisal b susceptibility official-regulation]

to setup
  clear-all
  create-turtles N [
    setxy random-xcor random-ycor
    set shape "person"
    set color white
    set official-regulation R
    set size 0.5]
  ask n-of sensitive turtles [set susceptibility 1.2]
  ask n-of neutral turtles with [susceptibility != 1.2] [set susceptibility 1]
  ask n-of firm turtles with [susceptibility != 1.2 and susceptibility != 1][set susceptibility 0.8]
  ask turtles [set appraisal susceptibility * (log(1 + random 9) 10)]
  ask turtles [set emotion appraisal]
  ask turtles with [emotion = 0][set color white]
  ask turtles with [emotion <= 0.4 and emotion > 0][set color green]
  ask turtles with [emotion > 0.4 and emotion <= 0.8][set color yellow]
  ask turtles with [emotion > 0.8 and emotion <= 1][set color red]
  ask turtles with [susceptibility = 1.2][set b 0.6 + random-float 0.4]
  ask turtles with [susceptibility = 1][set b 0.4 + random-float 0.2]
  ask turtles with [susceptibility = 0.8][set b random-float 0.4]
  reset-ticks
end 

to go
   while [ticks <= arrival-tick]
    [ask turtles [ifelse (b * (susceptibility * (log (1 + sum sort [emotion] of turtles-here) 10)) + (1 - b) * appraisal) <= 1[set emotion (b * (susceptibility * (log (1 + sum sort [emotion] of turtles-here) 10)) + (1 - b) * appraisal)]
      [set emotion 1]]
      check-color
    ask turtles with [color = green][if xcor <= -6 [facexy -8 1 rt asin random-float (1 / 2) lt asin random-float (1 / 2) fd random-float 1]]
    ask turtles with [color = green][if xcor > -6 and  xcor <= -2 [facexy -4 1 rt asin random-float (1 / 2) lt asin random-float (1 / 2) fd random-float 1]]
    ask turtles with [color = green][if xcor > -2 and  xcor <= 2 [facexy 0 1 rt asin random-float (1 / 2) lt asin random-float (1 / 2) fd random-float 1]]
    ask turtles with [color = green][if xcor > 2 and  xcor <= 6 [facexy 4 1 rt asin random-float (1 / 2) lt asin random-float (1 / 2) fd random-float 1]]
    ask turtles with [color = green][if xcor > 6 [facexy 8 1 rt asin random-float (1 / 2) lt asin random-float (1 / 2) fd random-float 1]]
    ask turtles with [color = yellow][if xcor <= -6 [facexy -8 1 rt asin random-float ((sqrt 3) / 2) lt asin random-float ((sqrt 3) / 2) fd random-float 2]]
    ask turtles with [color = yellow][if xcor > -6 and  xcor <= -2 [facexy -4 1 rt asin random-float ((sqrt 3) / 2) lt asin random-float ((sqrt 3) / 2) fd random-float 2]]
    ask turtles with [color = yellow][if xcor > -2 and  xcor <= 2 [facexy 0 1 rt asin random-float ((sqrt 3) / 2) lt asin random-float ((sqrt 3) / 2) fd random-float 2]]
    ask turtles with [color = yellow][if xcor > 2 and  xcor <= 6 [facexy 4 1 rt asin random-float ((sqrt 3) / 2) lt asin random-float ((sqrt 3) / 2) fd random-float 2]]
    ask turtles with [color = yellow][if xcor > 6 [facexy 8 1 rt asin random-float ((sqrt 3) / 2) lt asin random-float ((sqrt 3) / 2) fd random-float 2]]
    ask turtles with [color = red][if xcor <= -6 [facexy -8 1 rt asin random-float 1 lt asin random-float 1 fd random-float 3]]
    ask turtles with [color = red][if xcor > -6 and  xcor <= -2 [facexy -4 1 rt asin random-float 1 lt asin random-float 1 fd random-float 3]]
    ask turtles with [color = red][if xcor > -2 and  xcor <= 2 [facexy 0 1 rt asin random-float 1 lt asin random-float 1 fd random-float 3]]
    ask turtles with [color = red][if xcor > 2 and  xcor <= 6 [facexy 4 1 rt asin random-float 1 lt asin random-float 1 fd random-float 3]]
    ask turtles with [color = red][if xcor > 6 [facexy 8 1 rt asin random-float 1 lt asin random-float 1 fd random-float 3]]
      if official? [ask turtles [set emotion emotion * (1 - official-regulation)]]
      tick
  ]
  if random 100 <= P * 100 [ask turtles-on (patch-set patch -8 1 patch -4 1 patch 0 1 patch 4 1 patch 8 1) [die]]
  ifelse official? [ask turtles [set emotion emotion * (1 - official-regulation)]]
     [ask turtles [ifelse (b * (susceptibility * (log (1 + sum sort [emotion] of turtles-here) 10)) + (1 - b) * appraisal) <= 1 [set emotion (b * (susceptibility * (log (1 + sum sort [emotion] of turtles-here) 10)) + (1 - b) * appraisal)]
        [set emotion 1]]]
  check-color
  ask turtles with [color = white][if xcor <= -6 [facexy -8 1 fd random-float 1]]
  ask turtles with [color = white][if xcor > -6 and  xcor <= -2 [facexy -4 1 fd random-float 1]]
  ask turtles with [color = white][if xcor > -2 and  xcor <= 2 [facexy 0 1 fd random-float 1]]
  ask turtles with [color = white][if xcor > 2 and  xcor <= 6 [facexy 4 1 fd random-float 1]]
  ask turtles with [color = white][if xcor > 6 [facexy 8 1 fd random-float 1]]
  ask turtles with [color = green][if xcor <= -6 [facexy -8 1 rt asin random-float (1 / 2) lt asin random-float (1 / 2) fd random-float 1]]
  ask turtles with [color = green][if xcor > -6 and  xcor <= -2 [facexy -4 1 rt asin random-float (1 / 2) lt asin random-float (1 / 2) fd random-float 1]]
  ask turtles with [color = green][if xcor > -2 and  xcor <= 2 [facexy 0 1 rt asin random-float (1 / 2) lt asin random-float (1 / 2) fd random-float 1]]
  ask turtles with [color = green][if xcor > 2 and  xcor <= 6 [facexy 4 1 rt asin random-float (1 / 2) lt asin random-float (1 / 2) fd random-float 1]]
  ask turtles with [color = green][if xcor > 6 [facexy 8 1 rt asin random-float (1 / 2) lt asin random-float (1 / 2) fd random-float 1]]
  ask turtles with [color = yellow][if xcor <= -6 [facexy -8 1 rt asin random-float ((sqrt 3) / 2) lt asin random-float ((sqrt 3) / 2) fd random-float 2]]
  ask turtles with [color = yellow][if xcor > -6 and  xcor <= -2 [facexy -4 1 rt asin random-float ((sqrt 3) / 2) lt asin random-float ((sqrt 3) / 2) fd random-float 2]]
  ask turtles with [color = yellow][if xcor > -2 and  xcor <= 2 [facexy 0 1 rt asin random-float ((sqrt 3) / 2) lt asin random-float ((sqrt 3) / 2) fd random-float 2]]
  ask turtles with [color = yellow][if xcor > 2 and  xcor <= 6 [facexy 4 1 rt asin random-float ((sqrt 3) / 2) lt asin random-float ((sqrt 3) / 2) fd random-float 2]]
  ask turtles with [color = yellow][if xcor > 6 [facexy 8 1 rt asin random-float ((sqrt 3) / 2) lt asin random-float ((sqrt 3) / 2) fd random-float 2]]
  ask turtles with [color = red][if xcor <= -6 [facexy -8 1 rt asin random-float 1 lt asin random-float 1 fd random-float 3]]
  ask turtles with [color = red][if xcor > -6 and  xcor <= -2 [facexy -4 1 rt asin random-float 1 lt asin random-float 1 fd random-float 3]]
  ask turtles with [color = red][if xcor > -2 and  xcor <= 2 [facexy 0 1 rt asin random-float 1 lt asin random-float 1 fd random-float 3]]
  ask turtles with [color = red][if xcor > 2 and  xcor <= 6 [facexy 4 1 rt asin random-float 1 lt asin random-float 1 fd random-float 3]]
  ask turtles with [color = red][if xcor > 6 [facexy 8 1 rt asin random-float 1 lt asin random-float 1 fd random-float 3]]
  tick
end 

to check-color
  ask turtles with [emotion = 0][set color white]
  ask turtles with [emotion <= 0.4 and emotion > 0][set color green]
  ask turtles with [emotion > 0.4 and emotion <= 0.8][set color yellow]
  ask turtles with [emotion > 0.8 and emotion <= 1][set color red]
end 

There is only one version of this model, created 8 months ago by Ying Zhang.

Attached files

File Type Description Last updated
Emotional contagion in metro emergencies.png preview Preview for 'Emotional contagion in metro emergencies' 8 months ago, by Ying Zhang Download

This model does not have any ancestors.

This model does not have any descendants.