I am new to anylogic and am trying to build an agent-based model which randomly directs agents (vehicles) from a starting point (a Home location point on GIS map) to a selection of locations. I have 6 different sets of collections which have varying respective locations stored within them (SchoolsCollection, SupermarketsCollection, ShoppingCentresCollection, HospitalsCollection, TourismCollection and WorkOfficeCollection).
Within my statechart for my vehicles, I instruct it to visit 4 locations. So far I have only been able to make the agent move to a random location within one of the collections in each transition using: moveTo(randomFrom(main.HospitalsCollection)) for example.
But as I want my agent to randomly pick a location from the six collections above and not revisit the same class of collection from its previous journey, I am unsure on how to:
move my agent to randomly select a location from the collection of collections I have above
when moving on to the next location via the transition in my statechart, to not revsit the previous type of location it was just at (ie not go from one school in one trip and the following trip go to another school). From my limited experience, I would imagine this make use an if loop?
If you could help me with the above two queries that would be much appreciated!
Thanks in advance.