Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有一些使用前一个刻度的变量值的原语?我试图计算一个代理的“价格”变量,我的意思是使用包含其他代理的“价格”变量但来自前一个刻度的公式。
不,NetLogo 中没有内置的方法可以做到这一点。您最好的选择可能是创建一个名为 something 的变量varname-last-tick,然后将其更新为您在go这些代理程序中所做的最后一件事。听起来您想为代理使用的变量是“价格”,所以它类似于,
varname-last-tick
go
to agent-go do-stuff set price-last-tick price end
那么您可以[price-last-tick] of other agents在您的代码中使用而不是当前价格。
[price-last-tick] of other agents