Skip to content

Trouble understanding variable update #889

Answered by Robadob
zeyus asked this question in Q&A
Discussion options

You must be logged in to vote

I actually think spatial 2D messaging could be better for this code as well, but I don't think that is the issue here?

Spatial 2D is intended for continuous space agents (e.g. float coords, rather than int). It's generally alot more expensive in terms of performance.

I think your problem is misunderstanding array messages. They are literally an array, any element which does not have a message output to it, still exists, it just contains zero for every variable. So retrieve variable "id" and check that it's none-zero (0 is only used as an ID for agents who's ID has not yet been set).

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@zeyus
Comment options

@Robadob
Comment options

@Robadob
Comment options

@zeyus
Comment options

@Robadob
Comment options

Answer selected by zeyus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants