Closed hqnghi88 closed 1 year ago
I have decided to (finally !) add index
as a built-in constant attribute to agents. Why it was not there is a bit of a mystery (there was probably a reason once, but I can't remember it). This has to be tested carefully as it may have some implications on:
1) Models that import GIS data with an index
attribute and create agents from it: this index will not be considered
2) Species that declare an attribute called index
. It will conflict with the new attribute (esp. if it is not constant)
3) Code that uses an index
temp variable: warnings will appear.
Please report any further issues with this !
In the Inspect View of agent, we have its name,
but If we want to access it by index, for example, in interactive console, we need to query by where expression: write first((road where (each.name="road2604")).shape.perimeter;
Is there a simpler solution by using index? or we could add the agent's index to the inspect view? write road[2604].shape.perimeter;