Collaborative Culture, Gossip & the Give First Norm

Collaborative Culture, Gossip & the Give First Norm preview image

1 collaborator

Default-person First Author (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by the author
Model was written in NetLogo 7.0.3 • Viewed 37 times • Downloaded 0 times • Run 0 times
Download the 'Collaborative Culture, Gossip & the Give First Norm' 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, titled "Collaborative Culture, Gossip & the Give First Norm," is a multi-agent simulation derived from the study on how entrepreneurial ecosystems sustain collaboration. It explores the interplay between behavioral profiles (Altruists, Free-riders, and Vigilantes), individual reputations, and the circulation of "reputational gossip."

The core innovation is the use of Large Language Models (LLMs)—specifically Llama 3.2 via Ollama—to act as the "Social Brain" for agents. This allows agents to interpret qualitative reputation narratives and decide whether to provide help based on complex social context rather than simple binary rules.

HOW IT WORKS

The simulation consists of three types of agents:

Altruists (Green): Follow the "Give First" philosophy, generally cooperating with everyone.

Free-riders (Red): Act selfishly, seeking help from others but refusing to provide it.

Vigilantes (Blue): Conditional cooperators who help those with a good reputation but refuse those known for being uncooperative.

Key Mechanics:

Social Interaction: When agents meet, the responder evaluates the requester's reputation via the LLM to decide on a "YES/NO" response.

Reputation & Memory: Agents store qualitative memories of encounters (e.g., "GOOD: Collaborated successfully").

Gossip: With a set probability, agents share their memories about third parties with their partners, spreading information throughout the network.

Fitness: Successful cooperation increases an agent's fitness, representing startup success.

HOW TO USE IT

System Requirements:

NetLogo: Installed on your system (Version 7.0.4 recommended).

NetLogo Python Extension: Correctly configured.

Python 3.x: With the ollama library installed (pip install ollama).

Ollama: Running locally with the llama3.2:3b model.

Setup Instructions:

File Management: The Python script (social_brain.py) must be in the same folder as the NetLogo model file.

Initialization: Click Setup to initialize the environment, connect to Python, and assign personalities.

Execution: Click Go to start the simulation.

Sliders & Settings:

num-agents: Total population size.

initial-fitness: Starting resources.

gossip-probability: Likelihood of sharing information about others.

initial-knowledge-count: Amount of prior gossip agents have at Time Zero.

NETLOGO FEATURES

This model utilizes the NetLogo Python Extension to bridge agent-based modeling with generative AI. It demonstrates how to pass complex qualitative data (reputational narratives) to a local LLM and retrieve categorical decisions, creating "Generative Agents" that maintain a fully local execution environment.

Comments and Questions

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

Click to Run Model

extensions [ py ]

turtles-own [
  personality       ;; "Altruist", "Free-rider", "Vigilante"
  fitness           ;; Accumulated success (startup performance)
  memory-dict       ;; List of lists: [[other_ID "qualitative_opinion"] ...]
]

globals [
  collaboration-rate  
  total-interactions
  successful-helps
  
  fit-altruist
  fit-vigilante
  fit-freerider
]

to setup
  clear-all
  
  ;; 1. Initialize Python and load the script
  py:setup py:python3
  py:run "import social_brain"
  
  ;; 2. Create balanced agents (1/3 for each type)
  let agents-per-group floor (num-agents / 3)
  
  create-turtles agents-per-group [ set personality "Altruist" setup-individual-turtle ]
  create-turtles agents-per-group [ set personality "Free-rider" setup-individual-turtle ]
  create-turtles agents-per-group [ set personality "Vigilante" setup-individual-turtle ]
  
  ;; 3. Initialize basic memory (Everyone knows others exist)
  ask turtles [
    set memory-dict []
    let my-id who
    foreach sort [who] of other turtles [ other-id ->
      set memory-dict lput (list other-id "No previous information.") memory-dict
    ]
  ]
  
  ;; 4. SELECTIVE INITIAL INFORMATION ENDOWMENT (Time Zero)
  ;; Turtles can only have initial gossip about Altruists or Free-riders
  ask turtles [
    if initial-knowledge-count > 0 [
      ;; Filter candidates: only Greens (Altruists) or Reds (Free-riders)
      let candidates other turtles with [personality = "Altruist" or personality = "Free-rider"]
      
      if any? candidates [
        ;; Randomly pick based on slider (without exceeding total candidates)
        let n-to-pick min list initial-knowledge-count (count candidates)
        let acquaintances n-of n-to-pick candidates
        
        ask acquaintances [
          let target-id who
          let target-per personality
          let reputation-note ""
          
          ;; Initial gossip is truthful based on the polar profile
          ifelse target-per = "Free-rider" 
            [ set reputation-note "GOSSIP: BAD: Refused technical help." ]
            [ set reputation-note "GOSSIP: GOOD: Collaborated successfully." ]
          
          ask myself [
            ;; Directly update the memory list during setup
            let idx position target-id (map [ x -> first x ] memory-dict)
            set memory-dict replace-item idx memory-dict (list target-id reputation-note)
          ]
        ]
      ]
    ]
  ]
  
  set total-interactions 0
  set successful-helps 0
  set collaboration-rate 0
  reset-ticks
end 

to setup-individual-turtle
    set shape "person"
    setxy random-xcor random-ycor
    set fitness initial-fitness
    update-color
end 

to update-color
  if personality = "Altruist" [ set color green ]
  if personality = "Free-rider" [ set color red ]
  if personality = "Vigilante" [ set color blue ]
end 

to go
  ask turtles [ move ]

  ;; Select a random agent to be the protagonist of the tick
  ask one-of turtles [
    let partner one-of other turtles-here
    if partner != nobody [
      interact-with partner
      
      ;; Gossip after the encounter (Probability based on Slider)
      if (random-float 100 < gossip-probability) [
         share-gossip-with partner
      ]
    ]
  ]
  
  calculate-metrics 
  tick
end 

to move
  rt random 50
  lt random 50
  fd 1
end 

to interact-with [other-agent]
  let my-id who
  let my-per personality
  let target-id [who] of other-agent
  let target-per [personality] of other-agent
  
  ;; 1. The RESPONDER (other-agent) checks the reputation of the REQUESTER (self)
  let requester-reputation clean-text [get-memory-of my-id] of other-agent

  ;; 2. Consult AI for the decision
  let packet (word target-per "|" requester-reputation)
  let response py:runresult (word "social_brain.decide_to_help('" packet "')")
  
  print (word "Agent " target-id " (" target-per ") responds to Agent " my-id " (" my-per ") with reputation " requester-reputation ": [" response "]")
  set total-interactions total-interactions + 1
  
  ;; 3. The REQUESTER (self) updates its memory about the RESPONDER (other-agent)
  ;; Note: AI now responds with "YES" (English)
  ifelse (member? "YES" response) [
    set fitness fitness + 10
    set successful-helps successful-helps + 1
    ask other-agent [ 
      set fitness fitness - 3 
      update-personal-memory my-id "GOOD: Collaborated successfully." 
    ]
  ] 
  [
    update-personal-memory target-id "BAD: Refused technical help."
  ]
  
  set collaboration-rate (successful-helps / total-interactions) * 100
end 

to share-gossip-with [partner]
  ;; In the simulation, gossip can be about ANYONE (including Vigilantes)
  let third-agent one-of other turtles with [who != [who] of partner]
  
  if third-agent != nobody [
    let third-id [who] of third-agent
    let my-opinion get-memory-of third-id
    
    if my-opinion != "No previous information." [
      ask partner [ 
        update-personal-memory third-id (word "GOSSIP: " my-opinion) 
      ]
    ]
  ]
end 

;; --- UTILITIES ---

to update-personal-memory [target-id event]
  let previous-mem get-memory-of target-id
  let new-mem ""

  ifelse (member? "GOOD:" event or member? "BAD:" event) [
     set new-mem event ;; Priority given to direct experience (lived reality)
  ]
  [
     ifelse (member? "GOOD:" previous-mem or member? "BAD:" previous-mem) 
       [ set new-mem previous-mem ] 
       [ set new-mem event ]      
  ]

  let idx position target-id (map [ x -> first x ] memory-dict)
  set memory-dict replace-item idx memory-dict (list target-id new-mem)
end 

to-report clean-text [t]
  let result ""
  let t-str (word t) 
  foreach (range length t-str) [ i ->
    let c item i t-str
    if c != "'" and c != "\"" and c != "|" [ set result word result c ]
  ]
  report result
end 

to-report get-memory-of [target-id]
  let idx position target-id (map [ x -> first x ] memory-dict)
  report item 1 (item idx memory-dict)
end 

to calculate-metrics  
  let altruist-turtles turtles with [personality = "Altruist"]
  let vigilante-turtles turtles with [personality = "Vigilante"]
  let freerider-turtles turtles with [personality = "Free-rider"]

  if any? altruist-turtles [ set fit-altruist mean [fitness] of altruist-turtles ]
  if any? vigilante-turtles [ set fit-vigilante mean [fitness] of vigilante-turtles ]
  if any? freerider-turtles [ set fit-freerider mean [fitness] of freerider-turtles ]
end 

There is only one version of this model, created 16 days ago by First Author.

Attached files

File Type Description Last updated
Collaborative Culture, Gossip & the Give First Norm.png preview Preview for 'Collaborative Culture, Gossip & the Give First Norm' 16 days ago, by First Author Download
Figure_Simulation_Environment.png jpeg Image of the simulation environment in NetLogo. 16 days ago, by First Author Download
social_brain.py html Social brain code. It should be saved as a file named social_brain.py 16 days ago, by First Author Download

This model does not have any ancestors.

This model does not have any descendants.