Will you infect me with your opinion?

Will you infect me with your opinion? preview image

2 collaborators

20160405_001940000_ios Hendra Kusumah (Author)

Tags

information spread 

Tagged by Jaroslaw Miszczak almost 3 years ago

opinion dynamics 

Tagged by Jaroslaw Miszczak almost 3 years ago

virus spread 

Tagged by Jaroslaw Miszczak almost 3 years ago

Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.2.1 • Viewed 635 times • Downloaded 32 times • Run 0 times
Download the 'Will you infect me with your opinion?' 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?

This model incorporates three mechanisms shaping the dynamics of opinion formation, which mimics the dynamics of the virus spreading in the population. There are three methods of getting infected (or convinced) - direct contact, indirect contact, and contact with ``contaminated'' elements.

One should note that all three channels considered in the described model can be interpreted in the physical as well as digital environment. In the first case the direct communication is interpreted as face to face interaction, the second channel is interpreted as propagation via unintentional information gain, and the contaminated material is interpreted as a physical form of information distribution in the form of leaflets and posters. On the other hand, if we consider the propagation of information in the digital environment, the firs channel is interpreted as direct discussion via email or instant messengers, the third channel can be understood as a information obtained using mailing lists and mass mail distribution, and the third channel represent published content and comments published in the community. The main difference between the second and the third channel is that the last one has a potential for long-term impact on the opinion dynamics.

## HOW IT WORKS

The model describes a process of opinion formation. Each agent is either *infected* by some opinion, or he or she is clear (not infected). The interaction is not symmetric, since only infected agents can infect other agents. An agent can infect other agents in two situations. The first situation - **direct contact** - occurs when both occupy the same patch. The second situation - **indirect contact** - occurs when they occupy neighbouring patches.

Additionally, an infected agent can contaminate visited patches. This mechanism of opinion formation is introduced in analogy of **contact with contaminated objects**, surface or material, which can be considered as an additional channel for spreading some diseases.

## HOW TO USE IT

The parameters for controlling the model are divided into three sections.

In the setup section one can fix the population (slider *population*), percentage of patches which are considered as unavailable for agents (slider *init-obstacles-ratio*), as well as initial percentage of contaminated patches (slider *init-contamination-ratio*) and the initial number of infected agents (slider *init-infected-ratio*).

The second section - *Probabilities of the channels* - includes parameter of the opinion (or virus) spread. Slider *direct-infection-prob*, *indirect-infection-prob*, and *patch-infection-prob* can be used to change the probabilities of getting infected during the direct contact, the indirect contact, and via contact with a contaminated patch, respectively. The values of these probabilities are set independently.

The third section - *Parameters of agents and patches* - included parameters controling healing and mobility. In particular,

* slider *mobility-prob* controls the probability of agents ot make a move;

* slider *patch-contamination-prob* defines the probability of a patch to be contaminated by a visiting, sick agent;

* slider *agent-healing-prob* controls the probability of a sick agent to get healty at each tick;

* slilder *patch-heal-prob* controls the probability od a contaminated patch to get clean;

## THINGS TO NOTICE

The most interesting observation of the interplay between the weights assigned to particular channels. Weights assigned to all channels should sum up to one. However, in many situations, to low probability of getting infected via contact with contaminated patches (*patch-infection-weight*). In other words, setting too large value of *direct-infection-weight* is more likely to result in getting all agents healthy. On the other hand, by increasing the weight of the *patch-infection-weight* (or *indirect-infection-weight*), it is relatively easy to obtain a stable number of infected agents, independently of the other parameters, including mobility.

## THINGS TO TRY

One of the features of the model is the ability to control the mobility. This cab be dome by significantly limit the mobility with the hight perncetage of obstacles. On the other hand. one can control the probility of moving (slider *mobility*), and it can be changed during the run.

## EXTENDING THE MODEL

One of the possible extension of the model can be made by introducing two or more competing opinions. In this case, one has to introduce variables for marking the agents with their opinions. Additionally, one can consider different susceptibility (or immunity) of agents for adoption of other opinions.

## NETLOGO FEATURES

The model does not include the notion of the second opinion . Each agent can in one of two states - sick or convinced, represented by colour *red* and healthy or having no opinion, represented by colour *white*. Similarly, each patch can be contaminated (pink) or clean (white). Black patches represent obstacles and are fixed during the setup phase.

There is also no notopn of a gossip of false opinion, whcih could be interpreted as information obtained accidentaly. For the purpose of modelling this kind of process a second channel could be used.

## RELATED MODELS

There are several models in the NetLogo Models Library related to virus spread. In particular, Virus on a Network incorporates additional topology of connections, which could provide additional method of extending the presented model.

## CREDITS AND REFERENCES

The model has been developed by Jaroslaw Miszczak and Krzysztof Domino, Institute of Theoretical and Applied Informatics, Polish Academy of Sciences.

Comments and Questions

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

Click to Run Model

turtles-own [
  sick?
  sick-time
  healty-time
  total-sick-time
  total-healty-time
]

patches-own [
 contaminated?
]

globals [
  %infected
  %contaminated
]

to setup
  clear-all
  setup-patches
  setup-turtles
  ;;update-global-variables
  reset-ticks
end 

to go
  ask turtles [
    move-turtles
    get-infected
    infect-patches

    if sick? [
      set sick-time sick-time + 1
      set total-sick-time total-sick-time + 1
    ]

    if not sick? [
      set total-healty-time total-healty-time + 1
    ]

    if random-float 1.0 < agent-healing-prob [
      get-healthy
      set sick-time 0
    ]
  ]

  ask patches [
    heal-patches
  ]

  update-global-variables
  tick
end 

;; generate obstacles and containated patches

to setup-patches

  ;; generate random obstacles for simulating interiors
  ask patches [
    set contaminated? false
    ifelse random-float 100 < init-obstacles-ratio
    [ set pcolor black ]
    [ set pcolor white ]
  ]

  ;; distribute contaminating material on the patches which are not obstacles
  ask patches [
    if pcolor = white and random-float 100 < init-contamination-ratio
    ;; this is a contaminated patch
    [
      set pcolor pink
      set contaminated? true
    ]
  ]
end 

;; create agents and make some of them sick

to setup-turtles
  let move-to-patches patches with [ pcolor != black ]
  create-turtles population [
    set shape "person"
    set sick-time 0
    set total-healty-time 0.0001
    if any? move-to-patches [ move-to one-of move-to-patches ]
    get-healthy
  ]

  ask n-of (population * init-infected-ratio / 100) turtles [
    get-sick
    set sick-time 0
    set total-sick-time 0
  ]
end 

;; update reporting variables

to update-global-variables
  if count turtles > 0 [
    set %infected (count turtles with [ sick? ] / count turtles) * 100
  ]

  set %contaminated ( count patches with [ contaminated? ] / count patches with [ not contaminated? ] ) * 100
end 

;;
;; model dynamics
;;

;; avoid obstacles during the move

to move-turtles
  if random-float 1 < mobility-prob [
    let move-to-patches neighbors with [ pcolor != black ]
    if random-float 1.0 <  (count move-to-patches) / (count neighbors) [
      if any? move-to-patches [ move-to one-of move-to-patches ]
    ]
  ]
end 

;; three methods for getting infected

to get-infected
  get-infected-by-contamination
  get-infected-by-contact
  get-infected-by-proximity
end 

;; get infected by contact with contaminated patch

to get-infected-by-contamination
  if contaminated? and random-float 1 < patch-infection-prob
  [
    get-sick
  ]
end 

;; get infected by a direct contact with another agent

to get-infected-by-contact
  if (count other turtles-here with [ sick? ])  > 0
  [
    if random-float 1 < direct-infection-prob
    [
      get-sick
    ]
  ]
end 

;; get infected be getting around a sick agent

to get-infected-by-proximity
  if (count other (turtles-on neighbors4) with [ sick? ]) > 0
  [
    if random-float 1 < indirect-infection-prob
    [
      get-sick
    ]
  ]
end 

;; leave some contaminating material on the patch

to infect-patches
  if sick? and random-float 1 < patch-contamination-prob
  [
    set pcolor pink
    set contaminated? true
  ]
end 

;; healing process for patches

to heal-patches
  if contaminated? and random-float 1 < patch-heal-prob
  [
    set pcolor white
    set contaminated? false
  ]
end 

;; getting sick

to get-sick
  set sick? true
  set color red
  set sick-time 1
end 

;; recovering from the infection

to get-healthy
  set sick? false
  set color green
  set sick-time 0
end 
;;

;; only sick agents are immune

to-report immune?
  report sick-time > 0
end 

;;
;; reporters for plotting and for the experiments
;;

;; number of sick agents

to-report how-many-sick
  report count turtles with [ sick? ]
end 

;; ratio of sick agents

to-report ratio-sick
  report count turtles with [ sick? ] / count turtles
end 

;; number of contagenous patches

to-report how-many-cont
  report count patches with [ pcolor = pink ]
end 

;; ratio of contagenous patches

to-report ratio-cont
  report count patches with [ pcolor = pink ] / count patches
end 

;; mean sick time of cyrrently sick agents

to-report mean-sick-time
  report mean [sick-time] of turtles
end 

;;

to-report mean-total-sick-time
  report (mean [total-sick-time] of turtles) / (mean [total-healty-time] of turtles)
end 

There are 4 versions of this model.

Uploaded by When Description Download
Jaroslaw Miszczak about 1 year ago Reverted to older version Download this version
Hendra Kusumah almost 2 years ago update Download this version
Jaroslaw Miszczak over 2 years ago Simplified and updated model Download this version
Jaroslaw Miszczak almost 3 years ago Initial upload Download this version

Attached files

File Type Description Last updated
Will you infect me with your opinion?.png preview Preview for 'Will you infect me with your opinion?' almost 3 years ago, by Jaroslaw Miszczak Download

This model does not have any ancestors.

This model does not have any descendants.