Increment value increasing exponentially

江枫思渺然 提交于 2020-01-16 00:44:07

问题


I am currently trying to increase the value of an attribute belonging to every agent of the same breed. Every frame the attribute should increase by a pre-determined value, in this case 1.

ask breed [if attribute < max-value [set attribute attribute + 1]]

I have two agents of this breed in the model and they both change the attribute at the same pace i.e

tick0: 100 (100 is the starting value) tick1: 100 tick2: 101 tick3: 103 tick4: 106 tick5: 110 tick6: 121 tick7: 128

There seems to be a pattern here although I can't figure out why it's increasing the attribute rather than incrementing by 1. Anybody came across anything like this before?


回答1:


Ah silly mistake. I was calling this through another agent whose population was increasing per frame!



来源:https://stackoverflow.com/questions/22744810/increment-value-increasing-exponentially

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!