Information diffusion process model

Information diffusion process model preview image

2 collaborators

Emilio_sulis Emilio Sulis (Author)
Marcella Tambuscio (Author)

Tags

information spread 

Tagged by Emilio Sulis 15 days ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 6.1.1 • Viewed 30 times • Downloaded 0 times • Run 0 times
Download the 'Information diffusion process 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

extensions [ nw ]

turtles-own [ state ] ;; Three states of agents: "B" (believer) ;  "F" (factChecker) ; "S" (susceptible)

links-own [ weigth ]  ;; the weight of the links between agents

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

to setup
  ca
  setup-var
  setup-turtles
  update-plot
  reset-ticks
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;   GO   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to go
  tick
  if ticks > 300 [stop]   ;; stop condition (300 units of time)

  spreading               ;
  forgetting              ;-- Three main procedures for agent's behavior
  veryfing                ;

  update-colors           ;; just to improve the visualisation
  update-plot             ;; update plots of the Interface
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  SETUP PROCEDURES  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to setup-var
  set-default-shape turtles "person"
  set-default-shape links "curved link"
  update-output
end 

to update-output
  clear-output
  output-print "* Diffusion model in social networks *"
  if Type-of-network = "BA" [output-print "Barabási–Albert network"]
  if Type-of-network = "ER" [output-print "Erdős–Rényi network"]
end 

to setup-turtles
  if Type-of-network = "Barabási–Albert algorithm" [ nw:generate-preferential-attachment turtles links number-of-agents 3 ]
  if Type-of-network = "Erdős–Rényi model" [
    if number-of-agents > 100 [
      if PC-low-performance? and ask-proceed? [
        clear-output output-print (word "Erdős–Rényi model with " number-of-agents " nodes.")
        nw:generate-random turtles links number-of-agents 0.00585
      ]
    ]
  ]
 init-edges
end 

to init-edges
  ask links [set color 3]
  ask turtles
  [ setxy random-xcor random-ycor
    ifelse random 100 <= 90 [ set state "S" ][ set state "B" ]
  ]
  update-colors
end 

to update-colors
  ask turtles [
    if state = "B" [ set color blue ]
    if state = "F" [ set color red ]
    if state = "S" [ set color gray ]
  ]
end 

to update-plot
  set-current-plot "State-of-people"
  set-current-plot-pen "BELIEVERS"
  plot count turtles with [state = "B"]
  set-current-plot-pen "FACT-CHECKERS"
  plot count turtles with [state = "F"]
  set-current-plot-pen "SUSCEPTIBLES"
  plot count turtles with [state = "S"]
end 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  GO PROCEDURES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to spreading  ;; each agent modifies with some probability its state considering the points of view (states) of its neighbors;
  ; S -> B and S -> F according to:
  ; S -> B : "spreading" function for the hoax (fi)
  ; S -> F : disseminate among the immediate neighborhood of a vertex (gi)
  ask turtles with [state = "S"][
    let nB count link-neighbors with [state = "B"] ; n-of neighbors Believers
    let nF count link-neighbors with [state = "F"] ; n-of neighbors Fact-checkers
    let _1PlusA ( 1 + alpha-hoaxCredibility)
    let _1MinusA ( 1 - alpha-hoaxCredibility)
    let den (nB * _1PlusA + nF * _1MinusA)
    let f 0
    let g 0
    if den != 0 [
      set f beta-spreadingRate * ( nB * _1PlusA / den )
      set g beta-spreadingRate * ( nF * _1MinusA / den )
    ]

    let random-val-f random-float 1
    ifelse random-val-f < f
    [ set state "B" ]
    [ if random-val-f < (f + g) [ set state "F" ]
    ]
  ]
end 

to forgetting  ;; B -> S; F -> S  -- Each agent, regardless of belief state, forgets the news with a fixed probability pforget
  ask turtles with [state = "B" or state = "F"][
    if random-float 1 < pForget [
      set state "S"
    ]
  ]
end 

to veryfing  ;; B-> F ; each agent can fact-check the hoax with a fixed probability pverify;
  ask turtles with [state = "B"][
    if random-float 1 < pVerify [
      set state "F"
    ]
  ]
end 

;;;;;;;;;;;;;;;;;;;;;;; UTILS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;

to-report ask-proceed?
  report user-yes-or-no? "The network can be too wide to display in old PC: may suggest you to disable 'view updates' before press 'GO' button? Press Y to continue"
end 

There is only one version of this model, created 16 days ago by Emilio Sulis.

Attached files

File Type Description Last updated
Information diffusion process model.png preview Preview for 'Information diffusion process model' 16 days ago, by Emilio Sulis Download

This model does not have any ancestors.

This model does not have any descendants.