Social Pressure and Protection Motivation

Social Pressure and Protection Motivation preview image

1 collaborator

Default-person V K (Author)

Tags

protection motivation theory 

Tagged by V K 8 months ago

social pressure 

Tagged by V K 8 months ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.3.0 • Viewed 38 times • Downloaded 7 times • Run 0 times
Download the 'Social Pressure and Protection Motivation' 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

undirected-link-breed [friends friend]
undirected-link-breed [locals local]

globals [
  average_smoking_attitude
  average_security_desire
  average_conformity_desire
  average_hedonism_desire
  count_change_environment
  count_maladaptive_behavior
  count_adaptive_behavior
  count_adjust
  count_do_nothing
  objective_severity
  n_smokers
  n_non_smokers
  n_casuals
]

turtles-own [
  smoking_attitude
  health_status
  security_desire
  conformity_desire
  hedonism_desire
  people_nearby
  avg_peer_attitude
  avg_local_attitude
  avg_perceived_attitude
  intrinsic_rewards
  extrinsic_rewards
  severity
  vulnerability
  response_efficacy
  self_efficacy
  response_cost
  threat_appraisal
  coping_appraisal
  days_since_env_change
]
friends-own [connection_strength]
locals-own [connection_strength]


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;                                                                                                 ;;
;;                                              SETUP                                              ;;
;;                                                                                                 ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


; Creates agents, initiates their desires, friends and pmt variables.

to setup
  ca
  random-seed seed
  set objective_severity 0.64 ;relative value calculated from statista data
  set count_change_environment 0
  set count_maladaptive_behavior 0
  set count_adaptive_behavior 0
  set count_do_nothing 0
  set count_adjust 0
  let total_people_percent  conformity_people + hedonism_people + security_people

  let n_conformity_people int( (conformity_people / total_people_percent) * n_people ) + 1
  let n_hedonism_people int( (hedonism_people / total_people_percent) * n_people ) + 1
  let n_security_people int( (security_people / total_people_percent) * n_people ) + 1
  if (n_security_people + n_conformity_people + n_hedonism_people < n_people) [
    let dif  n_people - ( n_security_people + n_conformity_people + n_hedonism_people )
    set n_conformity_people n_conformity_people + dif
  ]
  crt n_conformity_people [
    setxy random-xcor random-ycor
    set shape "face neutral"
    set conformity_desire (70 + (random (100 - 70))) / 100
    set security_desire (40 + (random (60 - 40))) / 100
    set hedonism_desire (40 + (random (60 - 40))) / 100
  ]

    crt n_hedonism_people [
    setxy random-xcor random-ycor
    set shape "face happy"
    set conformity_desire (40 + (random (60 - 40))) / 100
    set security_desire (0 + (random (30 - 0))) / 100
    set hedonism_desire (70 + (random (100 - 70))) / 100
  ]

    crt n_security_people [
    setxy random-xcor random-ycor
    set shape "face sad"
    set conformity_desire (40 + (random (60 - 40))) / 100
    set security_desire  (70 + (random (100 - 70))) / 100
    set hedonism_desire (0 + (random (30 - 0))) / 100
  ]

  ask turtles [
    set avg_peer_attitude 0
    set intrinsic_rewards 0
    set extrinsic_rewards 0
    set severity 0
    set vulnerability 0
    set response_efficacy 0
    set self_efficacy 0
    set response_cost 0
    set threat_appraisal 0
    set coping_appraisal 0
    set days_since_env_change 0
    set people_nearby nobody
    create-friends-with n-of number_of_friends other turtles
    init_health_status
    init_smoking_attitude ; initializes smoking_attitude
    set_color_for_turtles
  ]

  ask friends [
   init_friend
  ]
  calculate_average_smoking_attitude
  show-label
  watch-one
  reset-ticks
end 


; Initiates the health status of an agent as a random value [0,100]

to init_health_status
  set health_status (1 + (random (100 - 1))) / 100
end 


; Initiates smoking attitude of an agent depending on their security and hedonism desire

to init_smoking_attitude
    set smoking_attitude ((1 - security_desire) * hedonism_desire)
  ifelse (smoking_attitude > 0.5)[
    set n_smokers n_smokers + 1
  ]
  [set n_non_smokers n_non_smokers + 1]
end 


; Sets the color of a turtle based on their smoking attitude

to set_color_for_turtles
  (ifelse (   smoking_attitude >= 0.75) [set color red ]
    (smoking_attitude < 0.75 and smoking_attitude > 0.25) [set color orange]
    [set color green]
    )
end 


; Sets the connection strength between agents

to init_friend
    ifelse static? = true [
    set connection_strength 1
  ]
  [
    set connection_strength ( 80 + (random (120 - 80))) / 100
  ]
    set color red
    set thickness connection_strength / 4
end 


; Shows labels on links in interface

to show-label
  if label? = true [
    ask turtles [set label who]
    ask links [ set label precision connection_strength 3 ]]
end 


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;                                                                                                 ;;
;;                                         EXPERIMENT                                              ;;
;;                                                                                                 ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


; Executes the model for one tick

to go
  ;print (word "================================== tick # "ticks" ==================================")
  ask turtles [
    move
    connect_to_locals
  ]
  ask locals[
    set color green
    set connection_strength  1
    set thickness connection_strength / 4
  ]

    ask turtles [
      calculate_local_pressure
      calculate_social_pressure

      let friends_count count friend-neighbors
      let locals_count count local-neighbors
      let neighbors_count (friends_count + locals_count)
    ifelse (neighbors_count < 1 ) [
      set avg_perceived_attitude smoking_attitude
    ]
    [

      set avg_perceived_attitude ((avg_peer_attitude * (friends_count / neighbors_count)) + (avg_local_attitude * (locals_count / neighbors_count)))
      set avg_perceived_attitude avg_perceived_attitude * pressure_modifier
    ]

      protection_motivation
    ]

  calculate_average_smoking_attitude
  calculate_average_security_desire
  calculate_average_conformity_desire
  calculate_average_hedonism_desire
  show-label
  watch-one
  behavior
  tick
end 


; Runs the model for "ticks_to_run" times

to start
  loop [
    if ticks >= ticks_to_run [stop]
    go
  ]
end 


; Executes the agent behavior depending on the calculated threat and coping appraisal

to behavior
  ask turtles [
    ; raucher
    (ifelse ( smoking_attitude >= 0.5)[
      ; raucherfreunde
      (ifelse ( abs( smoking_attitude -   avg_perceived_attitude) <= change_rate  or smoking_attitude >= 0.98) [
        set count_do_nothing count_do_nothing + 1
      ]
        ;nichtraucherfreunde
      (coping_appraisal > threat_appraisal  ) [
        set count_adaptive_behavior count_adaptive_behavior + 1
        update_desires
      ]
      (threat_appraisal > coping_appraisal) [
      set count_maladaptive_behavior count_maladaptive_behavior + 1
          ifelse (days_since_env_change >= min_stay and abs( smoking_attitude -   avg_perceived_attitude) >= contact_termination ) [
            change_environment
            set days_since_env_change 0
          ]
          [
          set days_since_env_change days_since_env_change + 1
          update_desires
          ]
      ]
        )
    ]
     ; nichtraucher
    (smoking_attitude <= 0.5) [
      (ifelse ( abs( smoking_attitude -   avg_perceived_attitude) <= change_rate  or smoking_attitude <= 0.02) [
        set count_do_nothing count_do_nothing + 1
        ]
      (coping_appraisal > threat_appraisal ) [
       ifelse (days_since_env_change >= min_stay and abs( smoking_attitude -   avg_perceived_attitude) >= contact_termination)  [
            change_environment
            set days_since_env_change 0
          ]
          [
          set days_since_env_change days_since_env_change + 1
          update_desires
          ]
      ]
      (threat_appraisal > coping_appraisal ) [
        set count_maladaptive_behavior count_maladaptive_behavior + 1
        update_desires
      ]
          )

    ]
    )
    let oldcolor color
    set_color_for_turtles
		if (color != oldcolor and color = red) [
      ifelse oldcolor = orange [set n_casuals n_casuals - 1][ set n_non_smokers n_non_smokers - 1]
      ;print (word who " turned red")
      set n_smokers n_smokers + 1

    ]
		if (color != oldcolor and color = green) [
      ifelse oldcolor = orange [set n_casuals n_casuals - 1][ set n_smokers n_smokers - 1]
      ;print (word who " turned green")
      set n_non_smokers n_non_smokers + 1
    ]

    if (color != oldcolor and color = orange) [
      ifelse oldcolor = red [set n_smokers n_smokers - 1][ set n_non_smokers n_non_smokers - 1]
    set n_casuals n_casuals + 1
    ]
	]
  show-label
  watch-one
end 


; Moves the agent for the specified distance

to move
  fd moving_distance
  rt random 360
end 


; Connects the agent to locals when distance is < 6

to connect_to_locals
  let turt_self self
  let turt_local self
  if (people_nearby != nobody) [
    ask people_nearby [
      if distance turt_self >= 6 [
        if local-with turt_self != nobody [
          ask local-with turt_self[die]
        ]
        set turt_local self
        let turt_local_set nobody
        if people_nearby != nobody [
          ask people_nearby [if self != turt_self [set turt_local_set (turtle-set turt_local_set self)]]
          set people_nearby turt_local_set
        ]
      ]
    ]
  ]
  let people_near_agent nobody
  if turt_local != turt_self [
    ask people_nearby [
      if self != turt_local [set people_near_agent (turtle-set people_near_agent self)]
    ]
    set people_nearby people_near_agent
  ]
  let friendships friend-neighbors
  let near_turtles other turtles with [distance turt_self < 6 and not member? self friendships]
  ask near_turtles [create-local-with turt_self]
  set people_nearby (turtle-set people_nearby near_turtles)
end 


; Calculates social pressure based on smoking attitude of friends

to calculate_social_pressure
  let my_friends friend-neighbors
  let turt self
  let avg_smoking_attitude 0
  let connections count my_friends
  ifelse connections > 0 [
    ask my_friends [
      let connectivity 0
      ask friend-with turt [set connectivity connection_strength]
      set avg_smoking_attitude (avg_smoking_attitude + (smoking_attitude * connectivity))
    ]
    set avg_peer_attitude (avg_smoking_attitude / connections)
    if avg_peer_attitude > 1 [set avg_peer_attitude 1]
  ]
    [set avg_peer_attitude 0]
end 


; Calculates social pressure based on smoking attitude of locals

to calculate_local_pressure
  let my_locals local-neighbors
  let turt self
  let avg_smoking_attitude 0
  let connections count my_locals
  ifelse connections > 0 [
    ask my_locals [
      set avg_smoking_attitude (avg_smoking_attitude + smoking_attitude)
    ]
    set avg_local_attitude (avg_smoking_attitude / connections)
  ]
    [set avg_local_attitude 0]
end 


; Calculates values for adaptive and maladaptive response

to protection_motivation
  calculate_threat_appraisal
  calculate_coping_appraisal
end 


; Calculates values for maladaptive response

to calculate_threat_appraisal
  calculate_intrinsic_rewards
  calculate_extrinsic_rewards
  init_severity
  init_vulnerability
  set threat_appraisal ((intrinsic_rewards + extrinsic_rewards) / 2) - ((severity + vulnerability) / 2)
end 


; Calculates values for adaptive response

to calculate_coping_appraisal
  calculate_response_efficacy
  calculate_self_efficacy
  calculate_response_cost
  set coping_appraisal ((response_efficacy + self_efficacy) / 2) - response_cost
end 


; Sets the intrinsic rewards (agents smoking attitude)

to calculate_intrinsic_rewards
  set intrinsic_rewards smoking_attitude
end 


; Sets the extrinsic rewards (social pressure)

to calculate_extrinsic_rewards
  set extrinsic_rewards avg_perceived_attitude
end 


; Initiates severity componentn based on conformity desire, security desire and objective severity

to init_severity
  set severity (objective_severity + ((1 - conformity_desire) * (security_desire - objective_severity)))
end 


; Initiates vulnerability based on health status and security desire

to init_vulnerability
  set vulnerability 1 - (health_status + (security_desire - health_status) * health_status)
end 


; Calculates the response efficacy based on smoking attitude, vulnerability and severity

to calculate_response_efficacy
  set response_efficacy smoking_attitude * ((vulnerability + severity) / 2)
end 


; Calculates self efficacy (case: smoking attitude and social pressure both high or low --> higher self efficacy than if only one high)

to calculate_self_efficacy
  (ifelse
    ((smoking_attitude > 0.5) and (avg_perceived_attitude > 0.5)) or ((smoking_attitude <= 0.5) and (avg_perceived_attitude <= 0.5)) [
     set self_efficacy 1 - ((smoking_attitude + avg_perceived_attitude) / 2)
    ]
    (smoking_attitude > 0.5) and (avg_perceived_attitude <= 0.5) [
     set self_efficacy 1 - smoking_attitude
    ]
    (smoking_attitude <= 0.5) and (avg_perceived_attitude > 0.5) [
     set self_efficacy 1 - avg_perceived_attitude
    ]
  )
end 


; Calculates response cost based on smoking attitude and a by conformity desire discounted social pressure

to calculate_response_cost
  set response_cost (smoking_attitude + (conformity_desire * avg_perceived_attitude)) / 2
end 



; Adjusts desires of an agent towards the group mean

to update_desires
  set count_adjust count_adjust + 1
  let group_mean_hedonism 0
  let group_mean_security 0
  let group_mean_smoking_attitude 0
  let friend_turtles friend-neighbors
  let local_turtles local-neighbors
  ask friend_turtles [
    set group_mean_hedonism group_mean_hedonism + hedonism_desire
    set group_mean_security group_mean_security + security_desire
    set group_mean_smoking_attitude group_mean_smoking_attitude + smoking_attitude
  ]
  ask local_turtles [
    set group_mean_hedonism group_mean_hedonism + hedonism_desire
    set group_mean_security group_mean_security + security_desire
    set group_mean_smoking_attitude group_mean_smoking_attitude + smoking_attitude
  ]

  ; assumption: desires are more resistent to change than attitudes, thus for desires we take change_rate^2
  ifelse (count friend_turtles + count local_turtles) > 0 [
    set group_mean_hedonism group_mean_hedonism / (count friend_turtles + count local_turtles)
    set group_mean_security group_mean_security / (count friend_turtles + count local_turtles)
    set group_mean_smoking_attitude group_mean_smoking_attitude / (count friend_turtles + count local_turtles)
    set hedonism_desire hedonism_desire + (change_rate * (group_mean_hedonism - hedonism_desire))
    set security_desire security_desire + (change_rate * (group_mean_security - security_desire))
    set smoking_attitude smoking_attitude + (change_rate * (group_mean_smoking_attitude - smoking_attitude))
  ]
  [
    set hedonism_desire hedonism_desire
    set security_desire security_desire
    set smoking_attitude smoking_attitude
  ]
end 


; Lets an agent change environment by cutting ties with friends or locals with a too different smoking attitude

to change_environment
  set count_change_environment count_change_environment + 1
  let friend_turtles friend-neighbors
  ifelse count friend_turtles > 0 [
    let turt self
    let smoking_attitude_of_turt smoking_attitude
    let local_turtles local-neighbors
    let move_away false
    ask local_turtles [
      if abs(smoking_attitude_of_turt - smoking_attitude) > contact_termination [
        set move_away true
      ]
    ]
    if move_away = true [
      ask my-locals [die]
      fd 12
      rt random 360
    ]
    let friends_deleted nobody
    ask friend_turtles [
      if abs(smoking_attitude_of_turt - smoking_attitude) > contact_termination [
        ask friend-with turt [die]
        set friends_deleted (turtle-set friends_deleted self)
      ]
    ]
    if friends_deleted != nobody [
      let other_friends other turtles with [not member? self friends_deleted]
      let number_of_deleted_friends count friends_deleted
      let number_of_other_friends count other_friends
      ifelse number_of_other_friends >= number_of_deleted_friends [
        ask n-of number_of_deleted_friends other_friends [
          create-friend-with turt
          ask friend-with turt [init_friend]
        ]
      ]
      [
        ask n-of number_of_other_friends other_friends [
          create-friend-with turt
          ask friend-with turt [init_friend]
        ]
      ]
        let current_locals local-neighbors
        ask friend-neighbors [
          if member? self current_locals [ask local-with turt [die]]
        ]
      ]
    ]
    [
    create-friends-with n-of number_of_friends other turtles
    ask my-friends [
      init_friend
    ]
  ]
  set count_change_environment (count_change_environment + 1)
end 


; Calculates the average smoking attitude of all turtles

to calculate_average_smoking_attitude
  let sum_of_attitudes 0
  let num_turtles count turtles
  ask turtles [
    set sum_of_attitudes (sum_of_attitudes + smoking_attitude)
  ]
  set average_smoking_attitude (sum_of_attitudes / num_turtles)
end 


; Calculates the average security desire of all turtles

to calculate_average_security_desire
  let security_sum 0
  let num_turtles count turtles
  ask turtles [
    set security_sum (security_sum + security_desire)
  ]
  set average_security_desire (security_sum / num_turtles)
end 


; Calculates the average conformity desire of all turtles

to calculate_average_conformity_desire
  let conformity_sum 0
  let num_turtles count turtles
  ask turtles [
    set conformity_sum (conformity_sum + conformity_desire)
  ]
  set average_conformity_desire (conformity_sum / num_turtles)
end 


; Calculates the average hedonism desire of all turtles

to calculate_average_hedonism_desire
  let hedonism_sum 0
  let num_turtles count turtles
  ask turtles [
    set hedonism_sum (hedonism_sum + hedonism_desire)
  ]
  set average_hedonism_desire (hedonism_sum / num_turtles)
end 


; Highlights one agent in the interface

to watch-one
  if watch? = true [
    watch turtle 0
  ]
end 

There is only one version of this model, created 8 months ago by V K.

Attached files

File Type Description Last updated
Social Pressure and Protection Motivation.png preview Preview for 'Social Pressure and Protection Motivation' 8 months ago, by V K Download

This model does not have any ancestors.

This model does not have any descendants.