ClimateWise 1.2

ClimateWise 1.2 preview image

1 collaborator

Tags

Visible to everyone | Changeable by the author
Model was written in NetLogo 5.0 • Viewed 463 times • Downloaded 41 times • Run 0 times
Download the 'ClimateWise 1.2' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


Info tab cannot be displayed because of an encoding error

Comments and Questions

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

Click to Run Model

patches-own [
  co2             ;; amount of co2 on this patch
  o2              ;; amount of o2 on this patch
  temp            ;; temp on this patch
  ]

turtles-own [my-temp age x-origin y-origin home-range temp-diff wisdom]
 
globals [initial-temp max-temp min-temp max-factory min-factory max-forest min-forest action-timer ] 
 
breed [ climate-scientist ]
breed [anti-scientist]
breed [ citizen ]
breed [ forest ]
breed [ factory ]
breed [policy-makers]

;;;;;;;;;;;;;;;;;;;;;;;;
;;; Setup procedures ;;;
;;;;;;;;;;;;;;;;;;;;;;;;

to setup
  clear-all
  set-default-shape policy-makers "building institution"
  create-policy-makers 1   [ set size 1  set color gray  ] 
  set-default-shape climate-scientist "citizen student"
  create-climate-scientist no-of-climate-scientists   [ set size 2  set color black  ]   
  set-default-shape anti-scientist "person lumberjack"
  create-anti-scientist no-of-anti-scientists  [ set size 3  set color black  ]  
  set-default-shape citizen "citizen"   
  create-citizen no-of-citizens   [ set size 2  set color black];      
  set-default-shape factory "house colonial"
  create-factory initial-no-of-factories   [ set size 2  set color red  ]   
   set-default-shape forest "forest" 
  create-forest initial-no-of-forests   [ set size 2 set color green  ]   
 
  ask policy-makers [setxy max-pxcor max-pycor]
  ask factory [setxy random-xcor random-ycor]
  ask forest [setxy random-xcor random-ycor]
  ask climate-scientist [set x-origin random-xcor set y-origin  random-ycor setxy x-origin y-origin ]
  ask anti-scientist [set x-origin random-xcor set y-origin  random-ycor setxy x-origin y-origin ]
  ask citizen [set x-origin random-xcor set y-origin  random-ycor setxy x-origin y-origin set wisdom random-normal mean-public-wisdom 0.25]
  set max-factory initial-no-of-factories
  set min-factory initial-no-of-factories
  set max-forest initial-no-of-forests
  set min-forest initial-no-of-forests
  setup-patches
  reset-ticks
 set initial-temp 25
 set min-temp initial-temp
 set min-temp 25 set max-temp 25
end 

to setup-patches
  ask patches
  [ recolor-patch ]
end 

to recolor-patch  ;; patch procedure
if temp  >= 25 [ set pcolor scale-color red (co2 - o2) 10 0.1 ]
if temp < 25 [ set pcolor scale-color blue (o2 - co2) 10 0.1 ]
end 

;;;;;;;;;;;;;;;;;;;;;
;;; Go procedures ;;;
;;;;;;;;;;;;;;;;;;;;;

to go  ;; forever button
  if not any? citizen [ stop ]
  if not any? climate-scientist [ stop ]
  if not any? forest [ stop ]
  if ticks = stop-experiment [stop]
 
   ask factory
  [ set co2 co2 + 1 
    set o2 o2 - 1
    if o2 < 0 [set o2 0]
    set age age + 1
    if age > 500 + random 100 [hatch 1 [setxy random-xcor random-ycor set age 0 set size 2 set color red] ; move factories around
     die]
   ]
     diffuse co2 1
  
  ask forest
  [set o2 o2 + 1 
   set co2 co2 - 1
   if co2 < 0 [set co2 0]
    set age age + 1
    if age > 500 + random 100 [hatch 1 [setxy random-xcor random-ycor set age 0 set size 2 set color green]
      die]
  ]
  diffuse o2 1
  
if action-timer < 1 [ask policy-makers
  [
  if decision-making-system = "climate-scientist quorum" and count climate-scientist with [color = red]   >= quorum-threshold  and ticks > 1 
  ; plant forests and demolish factories occasionally
 [hatch-forest 1 [ setxy random-xcor random-ycor set age  0 set size 2 set color green set action-timer action-interval]  if count factory > 1 [ask one-of factory [die]] ] 

 if decision-making-system = "climate-scientist quorum" and count climate-scientist with [color = blue]   >= quorum-threshold  and ticks > 1 
 ; build factories and chop down forests forests occasionally
 [hatch-factory 1 [setxy random-xcor random-ycor set size 2 set color red set action-timer action-interval] if count forest > 1 [ask one-of forest [die]] ] 

 ;climate-scientists are excluded from the majority vote because they form such a negligable proportion of citizens in real life
 if decision-making-system = "public majority" and  count citizen with [color = red] / count citizen > (majority-threshold / 100) and ticks > 1 
 ; plant forests and demolish factories occasionally
 [hatch-forest 1 [ setxy random-xcor random-ycor set age  0 set size 2 set color green set action-timer action-interval ]  if count factory > 1 [ask one-of factory [die]] ] 

 if decision-making-system = "public majority" and  count citizen with [color = blue] / count citizen > (majority-threshold / 100) and ticks > 1 
 ; build factories and chop down forests forests occasionally
 [hatch-factory 1 [setxy random-xcor random-ycor set size 2 set color red set action-timer action-interval] if count forest > 1 [ask one-of forest [die]] ] 
  ] 
  ] 
      
ask climate-scientist 
  [ 
    set home-range science-dissemination
    move
    if ticks mod scientist-collection-interval = 0 [collect-data] ; determines interval between data collection
    ]
 
ask anti-scientist

[
 set home-range anti-science-dissemination
move
if count climate-scientist with [color = blue]   >= quorum-threshold  [set color red]
if count climate-scientist with [color = red]    >= quorum-threshold  [set color blue]
]  

ask citizen 
 [
  ;mean public wisdom low
  if count anti-scientist-here with [color = red] > 0  and wisdom <= -0.67 [set color red]
  if count anti-scientist-here with [color = blue]  > 0 and wisdom <= -0.67 [set color blue]

  ;mean public wisdom high 
  if count climate-scientist-here > 0 and count climate-scientist with [color = red]  >= quorum-threshold and wisdom >= 0.67 [set color red]
  if count climate-scientist-here > 0 and count climate-scientist with [color = blue] >= quorum-threshold and wisdom >= 0.67 [set color blue]
  if count climate-scientist-here > 0 and count climate-scientist with [color = black] >= (no-of-climate-scientists - quorum-threshold) and wisdom >= 0.67 [set color black]

  ;mean public wisdom intermediate 
  if count anti-scientist-here with [color = red] > 0  and wisdom > -0.67 and wisdom < 0.67 [set color red]
  if count anti-scientist-here with [color = blue] > 0 and wisdom > -0.67 and wisdom < 0.67  [set color blue]
  if count anti-scientist-here with [color = black]  > 0 and wisdom > -0.67 and wisdom < 0.67 [set color black]
  if count climate-scientist-here > 0 and count climate-scientist with [color = red]  >= quorum-threshold and wisdom > -0.67 and wisdom < 0.67 [set color red]
  if count climate-scientist-here > 0 and count climate-scientist with [color = blue] >= quorum-threshold and wisdom > -0.67 and wisdom < 0.67 [set color blue]
 ] 

ask patches [set temp co2 / 8 - o2 / 8 + 25   recolor-patch ]
; temperature not solely dependent on forests and factories

if max-temp < mean [temp] of patches [set max-temp  mean [temp] of patches]
if min-temp > mean [temp] of patches [set min-temp  mean [temp] of patches]
if count factory > max-factory [ set max-factory count factory]
if count factory < min-factory [ set min-factory count factory]
if count forest > max-forest [ set max-forest count forest]
if count forest < min-forest [ set min-forest count forest]
set action-timer action-timer - 1
tick
end 


;;;;;;;;;;;;;;;;;;;;;
;;;  Sub-routines ;;;
;;;;;;;;;;;;;;;;;;;;;

to add-factory
hatch-factory 1 [setxy random-xcor random-ycor set size 2 set color red set action-timer action-interval] if count forest > 1 [ask one-of forest [die]]  
end 

to  add-forest
hatch-forest 1 [ setxy random-xcor random-ycor set age  0 set size 2 set color green set action-timer action-interval]  if count factory > 1 [ask one-of factory [die]]  
end 

to move 
 rt random-float 90 - random-float 90
 fd 1
 if xcor > x-origin + home-range [set xcor x-origin + home-range] ; keep individual within home range
 if xcor < x-origin - home-range [set xcor x-origin - home-range]
 if ycor > y-origin + home-range [set ycor y-origin + home-range]
 if ycor < y-origin - home-range [set ycor y-origin - home-range]
end 

to collect-data
set my-temp [temp] of patch-here 
set temp-diff my-temp - initial-temp 
if temp-diff  >=  temperature-threshold  [set color red] 
if temp-diff < temperature-threshold  and temp-diff  > temperature-threshold * -1  [set color black]; undecided catgeory
if temp-diff  <= temperature-threshold * -1  [set color blue]
end   

to-report average-temp
  report mean [temp] of patches
end 


  

There is only one version of this model, created almost 11 years ago by Mike L Anderson .

Attached files

File Type Description Last updated
ClimateWise 1.2.png preview Preview for 'ClimateWise 1.2' almost 11 years ago, by Mike L Anderson Download

This model does not have any ancestors.

This model does not have any descendants.