EncodingTest

No preview image

1 collaborator

Default-person Arthur Hjorth (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 4.1.1 • Viewed 215 times • Downloaded 22 times • Run 0 times
Download the 'EncodingTest' 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 is a model illustrating the indeterminacy of the concept of public goods.

While at first sight, the purpose of the model may appear to be to test congestion charge as a policy, the underlying idea is illustrate how the same model may be interpreted differently by selecting and weighing some data over other.

HOW IT WORKS

Agents every morning make two choices:

1. Would I like to drive to work?

2. Can I afford to?

Question 1 is answered by comparing

HOW TO USE IT

This section could explain how to use the model, including a description of each of the items in the interface tab.

THINGS TO NOTICE

I found it interesting that the higher the

From a more practical policy-making point, the lesson is that people react to the result of policy, not to the problems solved by policy.

THINGS TO TRY

This section could give some ideas of things for the user to try to do (move sliders, switches, etc.) with the model.

EXTENDING THE MODEL

Pollution and average passengers are currently hard coded (car pollution: 7, average passengers per car: 1.5; bus pollution: 50, average passengers per bus: 35).

The number of busses is a result of

RELATED MODELS

This section could give the names of models in the NetLogo Models Library or elsewhere which are of related interest.

CREDITS AND REFERENCES

This model was built by Arthur Hjorth (arthur.hjorth at stx.oxon.org) and released under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)

It is based on an example by Professor of Ideology Michael Freeden.

Freeden, M. (2005), What Should the 'Political' in Political Theory Explore?. Journal of Political Philosophy

Comments and Questions

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

Click to Run Model

;; Interpreting Congestion Charge ;;
;; This model is based on Michael Freeden s example 
;; The purpose of this model is to show the ambiguity of political concepts such as public goods
;; and the interpretation of policies.
;; TODOS: price sensitivity 

globals [
  
  global-pollution-per-day               ;; pollution variable
  travel-time-added                      ;; traffic congestion, how congested is traffic. 
                                         ;; this variable adds itself to a vehicle s travel time
  average-travel-time                    ;; average travel time calculated per day per person
  
  yesterdays-travel-time-added           ;; the average travel time added per vehicle yesterday
                                         ;; this is key in people s decision making process for whether they want
                                         ;; to go by car or bus.
  turtles-driving                        ;; number of turtles driving on any day
  median-income-drivers                  ;; the median income of turtles who drive
  median-income-bussers                  ;; the median income of turtles who take the bus
  cars                                   ;; number of cars
  busses                                 ;; number of busses
  median-income-preference-met           ;; median income for those whose transport preference was met
  median-income-preference-not-met       ;; median income for those whose transport preference was not met
  turtles-preference-met                 ;; number of people whose prefernces are met
  turtles-preference-not-met             ;; number of people whose preferences are not met
  
  color?                                 ;; color code boolean
  
  avg-passengers-per-bus
  pollution-per-bus
  pollution-per-car
  avg-passengers-per-car
  population
]

turtles-own [
  income                                 ;; income level of turtle, 1-100
  car-love                               ;; how much the person wants to drive their car, 1-100
  willing-to-wait                        ;; how willing the person is to spend extra time on travelling by car
                                         ;; rather than travelling by public transport, 1-100
  wishes-to-drive?                       ;; would this person ideally drive today?
  can-afford-to-drive?                   ;; can this person afford to drive today
  will-drive-today?                      ;; will this person actually drive today
  preference-met?                        ;; true if person travels by preferred medians
]

;;;
;;; SETUP PROCEDURES
;;;

to setup
  ;; clean up
  reset-ticks
  clear-all
  
  set avg-passengers-per-bus 32
  set pollution-per-bus 50
  set pollution-per-car 7
  set avg-passengers-per-car 1.5
  set population 1089
  
  set color? false
  
  


  ;; create population
  create-turtles 1088
  [
    ;; setting shape person
    set shape "person"
    ;; placing randomly on map in unoccupied location
    move-to one-of patches with [any? turtles-here = false]
    ;;move-to first patches with  [any? turtles-here = false]
    

    
    ;; setting income randomly (will be changed as part of gini coefficient implementation)
    set income random 99
    set color white
    set car-love random 99
    set willing-to-wait random 99

    ;; adding 1 to all turtle properties to avoid divide by zero errors. Look up how to set a range for random and correct this. 
    set income income + 1
    set car-love car-love + 1
    set willing-to-wait willing-to-wait + 1
  ]
  
    create-turtles 1
  [
    ;; setting shape person
    set shape "person"

    ;; setting income randomly (will be changed as part of gini coefficient implementation)
    set income random 99
    set color white
    set car-love random 99
    set willing-to-wait random 99

    ;; adding 1 to all turtle properties to avoid divide by zero errors. Look up how to set a range for random and correct this. 
    set income income + 1
    set car-love car-love + 1
    set willing-to-wait willing-to-wait + 1
  ]
end 

to go
  ;; switch over yesterdays time travel
  set yesterdays-travel-time-added travel-time-added
  ;; ask all turtles to decide on going by car or not
  ask turtles [decide]
  ;; calculate number of cars and busses
  calc-vehicles
  ;; calculate the time delay created by number of cars
  calculate-delay-created
  ;; calculate median incomes for respectively drivers and non-drivers
  calculate-median-incomes
  ;; calculate how many turtles traveled by their preferred medians
  calculate-preference-met
  ;; calculate median income for those who traveled by preferred and those who did not.
  calculate-median-preference-met

 
  calc-pollution
end 

to color-code
  ifelse color? = false
  [
    set color?  true
  ]
  [
    set color?  false
  ]
end 

to calc-vehicles
  set cars count turtles with [will-drive-today? = true] / avg-passengers-per-car
  set busses count turtles with [will-drive-today? = false] / avg-passengers-per-bus
end 

to calculate-median-incomes
  ifelse any? turtles with [will-drive-today? = true]
  [
    set median-income-drivers median [income] of turtles with [will-drive-today? = true]
  ]
  [
    set median-income-drivers 0
  ]  
  ifelse any? turtles with [will-drive-today? = false]
  [
    set median-income-bussers median [income] of turtles with [will-drive-today? = false]
  ]
  [
    set median-income-bussers 0
  ]
end 

to calculate-preference-met
  set turtles-preference-met (count turtles - count turtles with [wishes-to-drive? = true and will-drive-today? = false])
  set turtles-preference-not-met population - turtles-preference-met
end 

to calculate-median-preference-met
  ;; if clause to avoid null pointer exc
  
  ifelse any? turtles with [(wishes-to-drive? = true and will-drive-today? = true) or wishes-to-drive? = false]
  [
     set median-income-preference-met median [income] of turtles with 
           [(wishes-to-drive? = true and will-drive-today? = true) or wishes-to-drive? = false]
  ]
  [
    set median-income-preference-met 0
  ]
  
  ;; if clause to avoid null pointer exc
  ifelse any? turtles with [wishes-to-drive? = true and will-drive-today? = false]
  [
     set median-income-preference-not-met median [income] of turtles with [wishes-to-drive? = true and will-drive-today? = false]
  ]
  [
    set median-income-preference-not-met 0
  ]
end   

to color-turtle
  ask turtles[
  ;; coloring people per income
  ;; dark red for lowest quartile, pink for next, light blue for next, dark blue for highest quartile
  if income <= 25
  [
    set color 15
  ]
  if income > 25 and income <= 50
  [
    set color 17
  ]
  if income > 50 and income <= 75
  [
    set color 95
  ]
  if income > 75
  [
    set color 105
  ]
  ]
end 

to white-turtle
  ask turtles
  [
    set color white
  ]
end 

to calc-pollution
  ;; calculates pollution by multiplying pollution per car with no of cars and ditto for busses
  set global-pollution-per-day cars * pollution-per-car + busses * pollution-per-bus
end 

to calculate-delay-created
  ;; calculates delay created by finding sum of vehicles. All vehicles cause same amount of delay which probably isnt true...
  set travel-time-added cars + busses
end 

to decide ;; turtle procedure. Decide on whether to drive that day or not.
    would-prefer-car
    can-afford-to-drive
    will-drive
end 

to would-prefer-car ;; this determines if the turtle would ideally drive
  ifelse (car-love - (yesterdays-travel-time-added / willing-to-wait)) > 0
  [
    set wishes-to-drive? true
  ]
  
  [
    set wishes-to-drive? false
  ]
end 

to can-afford-to-drive ;; this determines if the turtle can afford to drive. This needs to be tweaked to take into
                       ;; consideration feedback effect from congestion charge lowering price of public transp
  ifelse congestion-charge-cost / 2 > income
  [
    set can-afford-to-drive? false
  ]
  
  [
    set can-afford-to-drive? true
  ]
end 

to will-drive ;; this determines if the turle will actually drive
  ifelse wishes-to-drive? and can-afford-to-drive?
  [
    set will-drive-today? true
    set shape "car"
  ]
  [
    set will-drive-today? false
    set shape "bus"
  ]
end 

There is only one version of this model, created about 14 years ago by Arthur Hjorth.

Attached files

No files

This model does not have any ancestors.

This model does not have any descendants.