Leviathan

Leviathan preview image

1 collaborator

Jbradford_web3 John Bradford (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.0.2 • Viewed 361 times • Downloaded 26 times • Run 0 times
Download the 'Leviathan' 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?

Deffuant, Guillaume, Timoteo Carletti, and Sylvie Huet. “The Leviathan Model: Absolute Dominance, Generalised Distrust, Small Worlds and Other Patterns Emerging from Combining Vanity with Opinion Propagation.” Journal of Artificial Societies and Social Simulation 16, no. 1 (2012): 5. Available here: http://jasss.soc.surrey.ac.uk/16/1/5.html

Here is a copy of the abstract: "We propose an opinion dynamics model that combines processes of vanity and opinion propagation. The interactions take place between randomly chosen pairs. During an interaction, the agents propagate their opinions about themselves and about other people they know. Moreover, each individual is subject to vanity: if her interlocutor seems to value her highly, then she increases her opinion about this interlocutor. On the contrary she tends to decrease her opinion about those who seem to undervalue her. The combination of these dynamics with the hypothesis that the opinion propagation is more efficient when coming from highly valued individuals, leads to different patterns when varying the parameters. For instance, for some parameters the positive opinion links between individuals generate a small world network. In one of the patterns, absolute dominance of one agent alternates with a state of generalised distrust, where all agents have a very low opinion of all the others (including themselves)."

Each agent has a list of opinions about herself and other agents, ranging from -1 to +1. In this version, the parameter "condition" establishes the potential partners of each agent: global = all agents; local = agents within "influence_range"; and "small worlds" (see below).

NOTE: The article expresses the influence of j on i using the subscripts ij. Here, I use the subscript ij to express the influence of i on j.

ROUTINE: STEP 1: Opinion Propagation. Ask turtles, create an out-link "opinion" from turtle i to turtle j, and vice-versa, Oij and Oji. The "propagation coefficient" is called "intensity" here and is an attribute of opinions. The logistic equation is used. Intensity = 1 / (1 + exp (-1 * ((aij - aii) / sigma))), where aij is the evaluation of opinion i of j, and aii is the "self-regard" of agent i for herself. The basic idea expressed here is that "if i has a high opinion of j, then j is more influential." "Self-regard" is a turtle attribute. Sigma is a parameter which can be set in the interface.

The influence of j on i for i's self-regard is expressed as follows: aii = aii + (intensityij * rho * (aji - aii + noise)), where aii is self-regard of agent i, and "rho" is a parameter 'ruling the importance of opinion propagation.' Now that the self-regard of agent i is updated, the "evaluation" of agent j by agent i (aij) is calculated as follows: aij = aij + (intensityij * rho * (ajj - aij + noise)), where aij is the "evaluation" of opinion_ij, and ajj is the self-regard of agent j.

STEP 2: REPUTATION A list is created for agent i of all of its out-opinion neighbors excluding itself and its current partner j. The "Evaluation" of opinioniq is recorded, where q is the randomly selected neighbor. Then, the evaluation of opinioniq is used to update or influence j's evaluation of q, opinionjq, using the same equation above. The parameter "kneighbors" determines the number of other agents about which agent i gossips- i.e. the # of reputations of other turtles i communicates to j.

STEP 3: VANITY DYNAMICS. The idea is as follows: "agents tend to reward the agents that value them more positively than they value themselves and to punish the ones that value them more negatively than they value themselves." "Evaluation" of opinion ij is set as follows: Evalij = Evalij + (w * (aji - aii + noise)), where "w" is the parameter "vanity." In words, agent i's new evaluation of j is the old evaluation plus the difference between j's evaluation of i and i's self-evaluation, plus some noise.

Recap: Intensityij = 1 / (1 + exp (-1 * ((aij - aii) / sigma))) aii = aii + (intensityij * rho * (aji - aii + noise)) aij = aij + (intensityij * rho * (ajj - aij + noise)) aij = aij + (w * (aji - aii + noise))

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

;this model is for the web, and doesn't use the nw network extension
;extensions [nw]
directed-link-breed [opinions opinion]
opinions-own [
  evaluation
  intensity ;; propagation intensity

]

globals [
  turtles_list
  ]
turtles-own [

  N_Neighbors
  self-regard
  q_list

  degree

]

to setup
   clear-all
   reset-ticks
   set turtles_list []
   ;__clear-all-and-reset-ticks
 ;  nw:set-context turtles links

 M_presets
 network_presets

  create-turtles population [
         set size 1 set color blue  ; BLUE COLOR BECAUSE NOT COMPLYING WITH
         ;setxy random-pxcor random-pycor
         while [any? other turtles-here] [ let empty_patch one-of patches with [any? turtles-here = false] move-to empty_patch ]
        set color random-float 140
        set self-regard 0
   ]
      if Display_Mode = "Matrix" [
  ask turtles [set hidden? true]
   ]


   ask turtles [setup-neighbors
     set turtles_list fput self turtles_list
     ]
end 

to M_presets

if Model_Presets = "Equality" [
 ; set network_type "None"
  set condition "Global"
  set population 40
  set vanity 0.3
  set rho 0.01
  set noise_intensity 0.2
  set sigma 0.35
  set k_neighbors 5]

 if Model_Presets = "Elite" [
  ;  set network_type "None"
   set condition "Global"
  set population 60
  set vanity 0.3
  set rho 0.1
  set noise_intensity 0.2
  set sigma 0.3
  set k_neighbors 5]

    if Model_Presets = "Hierarchy" [
    ;   set network_type "None"
      set condition "Global"
  set population 40
  set vanity 0.2
  set rho 0.5
  set noise_intensity 0.2
  set sigma 0.3
  set k_neighbors 10]

     if Model_Presets = "Dominance" [
        ;set network_type "None"
       set condition "Global"
  set population 40
  set vanity 0.4
  set rho 0.8
  set noise_intensity 0.2
  set sigma 0.3
  set k_neighbors 2]

   if Model_Presets = "Crisis" [
   ;   set network_type "None"
     set condition "Global"
  set population 40
  set vanity 0.4
  set rho 0.35
  set noise_intensity 0.2
  set sigma 0.5
  set k_neighbors 2]

   if Display_Mode = "Matrix" [
  resize-world 0 population 0 population
 ; set-patch-size 8

   ]
end 

to network_presets

ask turtles [
  while [any? other turtles-here]
[let empty_patch one-of patches with [any? turtles-here = false] move-to empty_patch ]]

layout-spring turtles links 10 10 10
end 

to START!
ask opinions [if evaluation < -1 [set evaluation -1] if evaluation > 1 [set evaluation 1]]

ask turtles [
  opinion_propagation
 ; partner_selection
 ; interaction
 ; forgetting
]

graphics


  tick
end 

to graphics
  ask opinions [
  if evaluation < 0 [ set color blue]
  if evaluation > 0 [set color red]]

  if Display_Mode = "Matrix" [
    foreach sort opinions [ ?1 -> ask ?1 [let i [who] of end1 let j [who] of end2
      if evaluation < 0 [ask patch i j [set pcolor blue]]
      if evaluation > 0 [ask patch i j [set pcolor red]]]
       ]
  ]
end 

to opinion_propagation

let partner find-partner
if partner = nobody [set partner one-of other turtles]
let i [who] of self
let j [who] of partner

if opinion i j = nobody [
create-opinion-to partner [set evaluation 0]]

if opinion j i = nobody [ask partner [
  create-opinion-to turtle i [set evaluation 0]]]

 if Display_Mode = "Matrix" [
  ask links [set hidden? true]
   ]


;[ask opinion i j [set evaluation 1]]
;ask partner [create-opinion-to myself [set evaluation 0]]

let aii [self-regard] of self
let aji [evaluation] of opinion j i
let aij [evaluation] of opinion i j
let ajj [self-regard] of partner



ask opinion i j [
 set intensity  1 / (1 + exp (-1 * ((aij - aii) / sigma)))
]
let pij [intensity] of opinion i j


set self-regard aii + (pij * rho * (aji - aii + noise))
ask opinion i j [set evaluation aij + (pij * rho * (ajj - aij + noise))]

;;STEP 2:  REPUTATION
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
let no_gossip_list (list self partner) ;; list of agents that cannot be called upon
let t_list []
ask [out-opinion-neighbors] of self [set t_list fput self t_list]
;; creates a list of all neighbors

foreach no_gossip_list [ ?1 ->
  set t_list remove ?1 t_list ]
;; removes self and partner from the list of neighbors of agent i

; not including 'partner', and also another -1 because we're dealing with repeats
;; thus if you have 2 neighbors, the repeat would be 0?  No, to iterate once, it must say 'repeat 1'- repeating 0 causes
;; operation to be skipped.
let lnk count out-link-neighbors - 1
let k k_neighbors
let rpt min (list lnk k)
if length t_list > 0 [
repeat rpt [
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
let q one-of t_list
set t_list remove q t_list

 let q_i [who] of q
 let aiq [evaluation] of opinion i q_i

 if opinion j q_i = nobody [ask partner [create-opinion-to q]]

 let ajq [evaluation] of opinion j q_i
 ask partner [ask opinion j q_i [
 set evaluation evaluation + (pij * rho * (ajq - aiq + noise))

 ]
 ]

]
]
;;STEP 3:  VANITY DYNAMICS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

let w vanity
ask opinion i j [
  set evaluation evaluation + (w * (aji - aii + noise))]
;; in words, agent i's new evaluation of j is the old evaluation plus the difference between j's evaluation of i and i's self-evaluation
end 

to-report noise  ; not used here
let r random 2
ifelse r > 0 [set r 1][set r -1]
let p random-float noise_intensity
let fuzz p * r  ; -1 to +1
report fuzz
end 

to setup-neighbors

    if Condition = "Global"  [set N_Neighbors Other Turtles]

    if Condition = "Local"  [

      ;let town sublist (sort [ distance myself ] of other turtles) 0 Influence_Range
      let town min-n-of Influence_Range other turtles [distance myself]
      set N_Neighbors town]

  ;  if Condition = "Small Worlds" [
  ;    let town min-n-of Influence_Range other turtles [distance myself]
  ;    set N_Neighbors town
  ;    small-worlds]
end 

to-report find-partner
  ifelse N_Neighbors = 0 [let partner one-of other turtles report partner] [
let partner one-of N_Neighbors
  report partner
  ]
end 

There is only one version of this model, created almost 8 years ago by John Bradford.

Attached files

File Type Description Last updated
Leviathan.png preview Preview for 'Leviathan' almost 8 years ago, by John Bradford Download

This model does not have any ancestors.

This model does not have any descendants.