tax

tax preview image

1 collaborator

Default-person Al Pugh (Author)

Tags

inequality & taxation 

Tagged by Al Pugh about 7 years ago

Visible to everyone | Changeable by the author
Model was written in NetLogo 5.3.1 • Viewed 494 times • Downloaded 28 times • Run 0 times
Download the 'tax' 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

turtles-own [ wealth ]                                        ; A economic inequality ABM
globals [ exc tax totaltax gini counter sumexc ]              ; © Al Pugh, 2016

to setup
  ca    set gini 0    set counter 0    set totaltax 0
  ask patches [ set pcolor green ]                            ; set green background for contrast
  ask n-of 400 patches [                                      ; ask some patches to create agents
    sprout 1 [set shape "person" set wealth (90 + random 21)
      set heading random 360 ] ]
  ask turtles [ set color yellow ]                            ; initialize agent color
  update-gini         reset-ticks
end 

to go
  set sumexc 0
  ask turtles [
    set heading heading + random 10 fd 1                      ; move agent randomly
    wealthtax                                                 ; tax wealthy
    encounter ]                                               ; resolve agent encounters
  redistribute                                                ; redistribute taxes
  update-gini                                                 ; update Gini coefficient
  ; checkwealth                                               ; (for debugging only)
  tick
end                                                            ; (plot set up commands in plots)

to wealthtax
  if ( wealth > 1000 ) [                                      ; tax those with 10x mean starting wealth
    set tax ( wealthtaxrate / 100. * wealth )
    set wealth wealth - tax
    set totaltax totaltax + tax ]
end 

to encounter
  if ( count turtles-here = 2 ) [                              ; for every interaction of 2 agents:
    let n2 one-of other turtles-here
    set exc ( min [ wealth ] of turtles-here / 5.0 )           ; determine exchange amount
    set sumexc sumexc + exc                                    ; add to sum of exchanges
    set tax ( exc * salestaxrate / 100. )                      ; extract sales tax
    set totaltax totaltax + 2 * tax
    ifelse ( random 2 ) = 0                                    ; determine winner
      [ set wealth ( wealth - exc - tax )
        ask n2 [set wealth ( [wealth] of n2 + exc - tax ) ] ]
      [ set wealth ( wealth + exc - tax )
        ask n2 [set wealth ( [wealth] of n2 - exc - tax ) ] ]
    set color scale-color yellow                               ; color agents by wealth
      wealth 0 int max [ wealth ] of turtles ]
end 

to redistribute
  set counter counter + 1
  if ( totaltax > 0 ) [                                        ; distribute tax receipts
    ifelse ( poordist? )
      [ let share ( totaltax / count turtles ) / 2.0
        ask turtles [ set wealth  wealth + share ]             ; all agents get reduced share
        let npoor count turtles with [ wealth < 100.0 ]        ; define poor as < mean starting wealth
        let poorshare share * count turtles / npoor            ; poor get additional share
        ask turtles with [ wealth < 100.0 ] [
          set wealth wealth + poorshare ]
        set totaltax 0  ]
      [ let share ( totaltax / count turtles )                 ; agents share tax redistribution equally
        ask turtles [ set wealth wealth + share ]
        set totaltax 0 ]  ]
end 

to update-gini                                                  ; find Gini coefficient
  let sorted-wealths sort [wealth] of turtles
  let total-wealth sum sorted-wealths     let wealth-sum-so-far 0
  let index 0          let gini-index-reserve 0
  repeat count turtles [
    set wealth-sum-so-far (wealth-sum-so-far + item index sorted-wealths)
    set index (index + 1)
    set gini-index-reserve gini-index-reserve + (index / count turtles)
      - (wealth-sum-so-far / total-wealth) ]
  set gini (gini-index-reserve / count turtles) / 0.5
end 

to checkwealth                                                  ; check total wealth remains unchanged
  print sum [ wealth ] of turtles + totaltax
end 

There is only one version of this model, created about 7 years ago by Al Pugh.

Attached files

File Type Description Last updated
tax.png preview Preview for 'tax' about 7 years ago, by Al Pugh Download

This model does not have any ancestors.

This model does not have any descendants.