1

I made two simple models; one System Dynamics Model and one Agent Based Model in NetLogo. The SDM has a stock 'tourists' and its value depends on the in- and outflow. The value is re-calculated each tick. The tourists are sprouted in the ABM each tick. Now, I would like to use the value of the touristsStock as an input for the turtles that are sprouted each tick in the Agent Based Model. What is the best way to do this? I have already checked the example codes in the Model Library (Like the Tabonuco Yagrumo model) but it doesn't make any sense to me. What is the best way to integrate these models with each other? Thanks in advance!

The relevant piece of code of the ABM is as given below:

to go

  clear-turtles

  ;sprouts turtles only on patches with value beach AND patches that are close to the lagoon (calculated in ArcMap)
  ;the initial number of tourists is multiplied by the percentage of tourists that were satisfied in the previous tick.
  ;percentage of tourists that were not satisfied is subtracted from 100 and divided by 100 to make it a factor between 0-1.

  ask n-of (initial-number-tourists * ((100 - percent-dissatisfied) / 100)) (patches with [ beach_close_to_lagoon = 1])
  [
    sprout 1 [
      set color black
      set size 10
    ]
  ]

  ask turtles [
    set neighbor min-one-of other turtles [distance myself]  ;; choose my nearest tourist based on distance
    set distance-tourist distance neighbor                   ; measure/calculate distance of closest neighboring tourist
  ]

  ask turtles
  [ ifelse distance-tourist > 5
      [ set satisfied? True]
      [ set satisfied? False ] ]

  update-turtles                                             ;before the end of each tick, the satisfaction of each turtle is updated
  update-globals                                             ;before the end of each tick, the percentage of satisfied tourists is updated in globals

  ;clear-turtles                        ;because each tick represents one day, the tourists will leave the beach after one tick so the turtles will die

  tick

end
loet23
  • 21
  • 2

0 Answers0