0

I would like to add a monitor on my interface which shows the amount of firms-at-home (in %) of all firms in the setup-world.

I'm trying to set up firms (turtles) in an industry (world) which either produce at home (firms-at-home) or have offshored their production (offshore-firms). I have given them a firms-own called offshored? which is answered with either true or false.

I tried this code:

breed [ firms firm ]

firms-own [
  offshored?   ;; true or false
  reshored?   ;; true or false
]

to-report offshored-firms
  report 100 * [ if firms with offshored? true ] / n-of firms ]
end

to-report firms-at-home
  report 100 * [ if firms with offshored? false ] / n-of firms ]
end

Then I would put firms-at-home in the reporter window of my monitor.

I'm not dividing the number of offshored-firms or firms-at-home by the total number of firms because I just cannot figure out how. Thanks for your input!

user11277648
  • 53
  • 1
  • 5

0 Answers0