Urban (System Dynamics)

Urban (System Dynamics) preview image

1 collaborator

20160405_001940000_ios Hendra Kusumah (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.3.0 • Viewed 89 times • Downloaded 6 times • Run 0 times
Download the 'Urban (System Dynamics)' modelDownload this modelEmbed this model

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


Comments and Questions

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

Click to Run Model

extensions [table]
globals [table1 table2  table3 table4 table5 table6]

to setup

  ca
  system-dynamics-setup
  do-plot

  let mylist1 [[0 0.2] [0.2 0.25] [0.4 0.35] [0.6 0.5] [0.8 0.7] [1 1] [1.2 1.35] [1.4 1.6] [1.6 1.8] [1.8 1.96] [2 2] ]
  set table1 table:from-list mylist1

  let mylist2 [[0 2] [0.2 1.95] [0.4 1.8] [0.6 1.6] [0.8 1.35] [1 1] [1.2 0.5] [1.4 0.3] [1.6 0.2] [1.8 0.15] [2 0.1] ]
  set table2 table:from-list mylist2

  let mylist3 [[0 1.4] [0.2 1.4] [0.4 1.35] [0.6 1.3] [0.8 1.15] [1 1] [1.2 0.8] [1.4 0.65] [1.6 0.5] [1.8 0.45] [2 0.4] ]
  set table3 table:from-list mylist3

  let mylist4 [[0 0.2] [0.2 0.25] [0.4 0.35] [0.6 0.5] [0.8 0.7] [1 1] [1.2 1.35] [1.4 1.6] [1.6 1.8] [1.8 1.95] [2 2] ]
  set table4 table:from-list mylist4

  let mylist5 [[0 0.4] [0.1 0.7] [0.2 1] [0.3 1.25] [0.4 1.45] [0.5 1.5] [0.6 1.5] [0.7 1.4] [0.8 1] [0.9 0.5] [1 0] ]
  set table5 table:from-list mylist5

  let mylist6 [[0 1] [0.1 1.15] [0.2 1.3] [0.3 1.4] [0.4 1.45] [0.5 1.4] [0.6 1.3] [0.7 0.9] [0.8 0.5] [0.9 0.25] [1 0] ]
  set table6 table:from-list mylist6
end 

to go

  system-dynamics-go
;  set-current-plot "urban"
  system-dynamics-do-plot


  if ticks >= 100 [stop]
  do-plot
end 

to do-plot


  set-current-plot "Business"
  set-current-plot-pen "Business"
  plotxy ticks Business
  set-current-plot "Housing"
  set-current-plot-pen "Housing"
  plotxy ticks Housing
  set-current-plot "Population"
  set-current-plot-pen "Population"
  plotxy ticks Population
;  set-current-plot "trees"
;  set-current-plot-pen "tabonuco"
;  plotxy ticks amount-of-tabonuco
;  set-current-plot-pen "yagrumo"
;  plotxy ticks amount-of-yagrumo
end 

to-report lookup1 [key]  ;; if you really want ...

  let newKey precision key 1

  let n ifelse-value table:has-key? table1 newKey [newKey]

  [ifelse-value ((newKey * 10) mod 2 = 0) and (newKey <= 2) [precision newKey 1] [1]]

;  [0.8]

  let value table:get table1 n
  report value
end 

to-report lookup2 [key]  ;; if you really want ...

  let newKey precision key 1

  let n ifelse-value table:has-key? table2 newKey [newKey]

  [ifelse-value ((newKey * 10) mod 2 = 0) and (newKey <= 2) [precision newKey 1] [1]]

;  [0.8]

  let value table:get table2 n
  report value
end 

to-report lookup3 [key]  ;; if you really want ...

  let newKey precision key 1

  let n ifelse-value table:has-key? table3 newKey [newKey]

  [ifelse-value ((newKey * 10) mod 2 = 0) and (newKey <= 2) [precision newKey 1] [1]]

;  [0.8]

  let value table:get table3 n
  report value
end 

to-report lookup4 [key]  ;; if you really want ...

  let newKey precision key 1

  let n ifelse-value table:has-key? table4 newKey [newKey]

  [ifelse-value ((newKey * 10) mod 2 = 0) and (newKey <= 2) [precision newKey 1] [1]]

;  [0.8]

  let value table:get table4 n
  report value
end 

to-report lookup5 [key]  ;; if you really want ...

  let newKey precision key 1

  let n ifelse-value table:has-key? table5 newKey [newKey]

  [ifelse-value ((newKey * 10) mod 2 != 0) and (newKey <= 1) [precision newKey 1] [0]]

;  [0.8]

  let value table:get table5 n
  report value
end 

to-report lookup6 [key]  ;; if you really want ...

  let newKey precision key 1

  let n ifelse-value table:has-key? table6 newKey [newKey]

  [ifelse-value ((newKey * 10) mod 2 != 0) and (newKey <= 1) [precision newKey 1] [0.5]]

;  [0.8]

  let value table:get table6 n
  report value
end 

There is only one version of this model, created over 1 year ago by Hendra Kusumah.

Attached files

File Type Description Last updated
Urban (System Dynamics).png preview Preview for 'Urban (System Dynamics)' over 1 year ago, by Hendra Kusumah Download

This model does not have any ancestors.

Children:

Graph of models related to 'Urban (System Dynamics)'