Hi Harry and team,
I couldn't find anything in the manual or on this forum.
I was wondering if there was any way in model to check if an array has any repeating values.
My use case for this is to use as an internal auditing tool as model development is ongoing. I have a complex model where if the piping of the model is incorrectly applied it may mean that an entity may seize multiple resources when the most any one sim should have at any one time is one.
I have set it up so that whenever a resource is seized, this.obj is stored as a string in a custom map where the column of the map corresponds to the resource. Whenever it is released it is removed from this list (replaced with "" - on this note is there a simple way to prune these instead of filling the array with blanks?).
I want to be able to return a report at the end of the run that states whether in each cycle (1 y model time) a sim's 'this.obj' appears multiple times.
Is this possible within model? If so, is it computationally efficient?
Thanks,
Ben