Counterbalance Economics

No preview image

This model is seeking new collaborators — would you please help?

1 collaborator

Default-person Peter Malliaros (Author)

Tags

(This model has yet to be categorized with any tags)
Model group Counterbalance Economics | Visible to everyone | Changeable by group members (Counterbalance Economics)
Model was written in NetLogo 6.1.1 • Viewed 232 times • Downloaded 13 times • Run 0 times
Download the 'Counterbalance Economics' 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

globals
[
  max-grain    ; maximum amount any patch can hold
  gini-index-reserve
  lorenz-points


]

patches-own
[
  grain-here      ; the current amount of grain on this patch
  max-grain-here  ; the maximum amount of grain this patch can hold

 ]

turtles-own
[
  age              ; how old a turtle is
  wealth           ; the amount of grain a turtle has
  life-expectancy  ; maximum age that a turtle can reach
  metabolism       ; how much grain a turtle eats each time
  vision           ; how many patches ahead a turtle can see
  Tax-Collected    ; Amount of wealth reduced by tax
  Welfare          ; Amount received as welfare payment

]

breed [cooperative-turtles cooperative-turtle]
breed [rich-turtles rich-turtle]


;;;
;;; SETUP AND HELPERS
;;;

to setup
  clear-all
  ;; set global variables to appropriate values
  set max-grain 50
  ;; call other procedures to set up various parts of the world
  setup-patches
  setup-turtles
  update-lorenz-and-gini

  reset-ticks
end 

;; set up the initial amounts of grain each patch has

to setup-patches
  ;; give some patches the highest amount of grain possible --
  ;; these patches are the "best land"
  ask patches
    [ set max-grain-here 0
      if (random-float 100.0) <= percent-best-land
        [ set max-grain-here max-grain
          set grain-here max-grain-here ] ]
  ;; spread that grain around the window a little and put a little back
  ;; into the patches that are the "best land" found above
  repeat 5
    [ ask patches with [max-grain-here != 0]
        [ set grain-here max-grain-here ]
      diffuse grain-here 0.25 ]
  repeat 10
    [ diffuse grain-here 0.25 ]          ;; spread the grain around some more
  ask patches
    [ set grain-here floor grain-here    ;; round grain levels to whole numbers
      set max-grain-here grain-here      ;; initial grain level is also maximum
      recolor-patch ]
end 

to recolor-patch  ;; patch procedure -- use color to indicate grain level
  set pcolor scale-color yellow grain-here 0 max-grain
end 

;; set up the initial values for the turtle variables

to setup-turtles
  set-default-shape turtles "person"
  create-turtles num-people
    [ move-to one-of patches  ;; put turtles on patch centers
      set size 1.5  ;; easier to see
      set-initial-turtle-vars
      set age random life-expectancy ]
  recolor-turtles
end 

to set-initial-turtle-vars
  set age 0
  face one-of neighbors4
  set life-expectancy life-expectancy-min +
                        random (life-expectancy-max - life-expectancy-min + 1)
  set metabolism 1 + random metabolism-max
  set wealth metabolism + random 50
  set vision 1 + random max-vision
  set Tax-Collected (wealth * Tax-Collected-as-%-of-GDP)
  set Welfare (Tax-Collected * Welfare-Payment-to-Reds)
end 


;; Set the class of the turtles -- if a turtle has less than a third
;; the wealth of the richest turtle, color it red.  If between one
;; and two thirds, color it green.  If over two thirds, color it blue.
;; setup recolor based on chooser

to recolor-turtles
  let max-wealth max [wealth] of turtles

 ;; when chosen, this component returns this simulation back to its original setting to provide a baseline for comparison
  if ( Economic-System = "Original-Model" ) [ ask turtles [ ifelse (wealth <= max-wealth / 3)
        [ set color red ]
        [ ifelse (wealth <= (max-wealth * 2 / 3))
            [ set color green ]
      [ set color blue ] ] ]]


 ;; when chosen, this component simulates paying the bottom 50% of workers the AWE amount which in this simulation is the Average Total Wealth
  if ( Economic-System = "Counterbalance" ) [ ask turtles [ ifelse (wealth <= max-wealth / 3)
        [ set color red set wealth (avg-inc-total * CBE-Contra-Deal-Credit-AWE-Payment) ] ;; this line simulates paying the reds the AWE amount in Contra-Deal Credits
        [ ifelse (wealth <= (max-wealth * 2 / 3))
            [ set color green ] ;; In the CBE, everyone has a job, therefore, no unemployment benefits are required.
      [ set color blue ] ] ]] ;; therefore, governments can reduce the amount of tax paid by the greens and the blues
  ;; It is envisaged that any money saved, will be put back into the economy and that is simulated by reducing the tax rate to 1/3 of the normal tax rate for the greens and the blues

 ;; when chosen, this component allows you to vary the overall tax rate and the welfare paid to the reds
  if ( Economic-System = "Neoliberal-v-GovernmentRun" ) [ ask turtles [ ifelse (wealth <= max-wealth / 3)
    [ set color red set wealth ((wealth + Welfare) - Tax-Collected) ]
        [ ifelse (wealth <= (max-wealth * 2 / 3))
            [ set color green set wealth (wealth - Tax-Collected) ]
      [ set color blue set wealth (wealth - Tax-Collected) ] ] ]]
end 


;; Set the type of turtles -- if a turtle has less two thirds or less
;; then it is cooperative.
;; If over two thirds, then it is a rich turtle.

to setup-turtles-breeds
  let max-wealth max [wealth] of turtles
  ask turtles
    [ ifelse (wealth <= max-wealth * 2 / 3)
        [ set breed cooperative-turtles
      set color green ]
        [ set breed rich-turtles
      set color red ] ]
end 


;;;
;;; GO AND HELPERS
;;;

to go

if ticks >= 500 [ stop ]
  ask turtles
  [ turn-towards-grain ]  ;; choose direction holding most grain within the turtle's vision
  harvest
  ask turtles
    [ move-eat-age-die ]

recolor-turtles

  ;; grow grain every grain-growth-interval clock ticks
  if ticks mod wealth-growth-time = 0
    [ ask patches [ grow-grain ]]



  update-lorenz-and-gini

tick
end 


;; determine the direction which is most profitable for each turtle in
;; the surrounding patches within the turtles' vision

to turn-towards-grain  ;; turtle procedure
  set heading 0
  let best-direction 0
  let best-amount grain-ahead
  set heading 90
  if (grain-ahead > best-amount)
    [ set best-direction 90
      set best-amount grain-ahead ]
  set heading 180
  if (grain-ahead > best-amount)
    [ set best-direction 180
      set best-amount grain-ahead ]
  set heading 270
  if (grain-ahead > best-amount)
    [ set best-direction 270
      set best-amount grain-ahead ]
  set heading best-direction
end 

to-report grain-ahead  ;; turtle procedure
  let total 0
  let how-far 1
  repeat vision
    [ set total total + [grain-here] of patch-ahead how-far
      set how-far how-far + 1 ]
  report total
end 

to grow-grain  ;; patch procedure
  ;; if a patch does not have it's maximum amount of grain, add
  ;; num-grain-grown to its grain amount
  if (grain-here < max-grain-here)
    [ set grain-here grain-here + wealth-growth-volume
      ;; if the new amount of grain on a patch is over its maximum
      ;; capacity, set it to its maximum
      if (grain-here > max-grain-here)
        [ set grain-here max-grain-here ]
      recolor-patch ]
end 


;; each turtle harvests the grain on its patch.  if there are multiple
;; turtles on a patch, divide the grain evenly among the turtles

to harvest
  ; have turtles harvest before any turtle sets the patch to 0
  ask turtles
    [ set wealth floor (wealth + (grain-here / (count turtles-here) )) ]

  ;; now that the grain has been harvested, have the turtles make the
  ;; patches which they are on have no grain
  ask turtles
    [ set grain-here 0
      recolor-patch ]
end 

to move-eat-age-die  ;; turtle procedure
  fd 1

  set Tax-Collected (wealth * Tax-Collected-as-%-of-GDP)
  set Welfare (Tax-Collected * Welfare-Payment-to-Reds)

  ;; consume some grain according to metabolism
  set wealth (wealth - metabolism)
  ;; grow older
  set age (age + 1)
  ;; check for death conditions: if you have no grain or
  ;; you're older than the life expectancy or if some random factor
  ;; holds, then you "die" and are "reborn" (in fact, your variables
  ;; are just reset to new random values)
  if (wealth < 0) or (age >= life-expectancy)
    [ set-initial-turtle-vars ]
end 

;; this procedure recomputes the value of gini-index-reserve
;; and the points in lorenz-points for the Lorenz and Gini-Index plots

to update-lorenz-and-gini
  let sorted-wealths sort [wealth] of turtles
  let total-wealth sum sorted-wealths
  let wealth-sum-so-far 0
  let index 0
  set gini-index-reserve 0
  set lorenz-points []

  ;; now actually plot the Lorenz curve -- along the way, we also
  ;; calculate the Gini index.
  ;; (see the Info tab for a description of the curve and measure)
  repeat num-people [
    set wealth-sum-so-far (wealth-sum-so-far + item index sorted-wealths)
    set lorenz-points lput ((wealth-sum-so-far / total-wealth) * 100) lorenz-points
    set index (index + 1)
    set gini-index-reserve
      gini-index-reserve +
      (index / num-people) -
      (wealth-sum-so-far / total-wealth)
      ]
end 

to-report num-of-red
  report round count turtles with [color = red]
end 

to-report num-of-green
  report round count turtles with [color = green]
end 

to-report num-of-blue
  report round count turtles with [color = blue]
end 

to-report avg-inc-red
    report round sum [ wealth ] of turtles with [color = red] / num-of-red
end 

to-report avg-inc-green
    report round sum [ wealth ] of turtles with [color = green] / num-of-green
end 

to-report avg-inc-blue
    report round sum [ wealth ] of turtles with [color = blue] / num-of-blue
end 

to-report avg-inc-total
  report (sum [wealth] of turtles) / num-people
end 

to-report tot-wealth-world
  report round sum [ max-grain ] of patches + sum [wealth] of turtles
end 




; Copyright 1998 Uri Wilensky.
; See Info tab for full copyright and license.

There is only one version of this model, created almost 4 years ago by Peter Malliaros.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.