I'm trying to set up firms (turtles) in an industry (world) by assigning them different sizes according to their income (firms-own). The distinction between small, medium and large size should be dependent on the percentage of income in relation to the total income.
More specifically, dependent on their income I want the firms with the 30% lowest income to be of size 0.5, the firms with the 60% middle income to be of size 1, and the firms with the 10% highest income to be of size 1.5. So far I have:
breed [ firms firm ]
firms-own [
income
]
to setup
create-firms number-of-firms [ ;; number of firms to be defined through slider
set income random 100
if income = "low" [ set size 0.5 ] ;; firms with low output are of a small size
if income = "medium" [ set size 1 ] ;; firms with medium output are of a medium size
if income = "high" [ set size 1.5 ] ;; firms with high output are of a large size
end
I know the code does not work because I have not told the firms when to set their firms-own to "low", "medium", or "high". But I don't know how to get them to set it by percentage of the total income.
Thanks for your input here!