Remove iterator in loop

Just write your own iterator.

for obj in ActiveAgentIterator(Objects)

and then you defined your ActiveAgentIterator with suitable iterator interface functions (most special here will be the next function that will look for the next active agent).

See http://docs.julialang.org/en/stable/manual/interfaces/

1 Like