NETLOGO 我被要求为在界面中插入滑块的全局变量提供 "literal value"
NETLOGO I am asked for a "literal value" for a global variable inserted with slider in the interface
我想在“去”中写下这个补充:
ask population with [employed = false and color = grey] [
set moneyOnBankOfGrey sum [ moneyOnBankOfGrey - min-indiv-cost-of-living]
]
但是它给了我括号内“moneyOnBankOfGrey”的错误,它要求插入一个文字值。
但我在带有滑块的界面中将 moneyOnBankofGrey 作为全局变量输入。
我还想知道如何让这个计算在每次报价时都发生。非常感谢! :)
如果moneyOnBankOfGrey
是海龟变量,那么这可能就是你想要的:
set moneyOnBankOfGrey sum [ moneyOnBankOfGrey - min-indiv-cost-of-living ] of turtles
因此每只海龟计算其变量值与全局变量之间的差异,然后将所有这些差异加在一起
我想在“去”中写下这个补充:
ask population with [employed = false and color = grey] [
set moneyOnBankOfGrey sum [ moneyOnBankOfGrey - min-indiv-cost-of-living]
]
但是它给了我括号内“moneyOnBankOfGrey”的错误,它要求插入一个文字值。 但我在带有滑块的界面中将 moneyOnBankofGrey 作为全局变量输入。
我还想知道如何让这个计算在每次报价时都发生。非常感谢! :)
如果moneyOnBankOfGrey
是海龟变量,那么这可能就是你想要的:
set moneyOnBankOfGrey sum [ moneyOnBankOfGrey - min-indiv-cost-of-living ] of turtles
因此每只海龟计算其变量值与全局变量之间的差异,然后将所有这些差异加在一起