如何在NetLogo上以百分比形式接收绝对值而不是十进制数?

时间:2019-04-19 09:29:26

标签: decimal netlogo percentage agent-based-modeling

我已经在一个行业(世界)中设立了公司(乌龟),这些公司要么在家生产(位于ycor的家中公司),要么将其生产离岸(位于ycor的离岸公司)。我给了他们一个叫离岸公司的公司吗?答案为是或否。

我的界面上有一个监视器,该监视器显示设置世界中所有公司的离岸公司数量和本国生产的公司数量(%):

breed [ firms firm ]

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

to-report percentage-of-firms-at-home   ;; monitors the % of firms which produce at home
  report ( ( count firms with [ ycor > 0 ] ) / count firms ) * 100
end

to-report percentage-of-offshored-firms   ;; monitors the % of offshored firms
  report ( ( count firms with [ ycor < 0 ] ) / count firms ) * 100
end

然后我将percentage-of-offshored-firms插入接口上的监视器。现在,我想为我报告的百分比显示一个绝对数字。如何将到目前为止收到的十进制数字更改为绝对数字?

0 个答案:

没有答案