lundi 10 février 2020

In Anylogic, how to Randomly Select from a list of items

In Anylogic what is the easiest way to select randomly from a group of items you choose. For example, If you are creating new Customer agents and you have three existing populations of customers: customers1, customers2, customers3. How do you do a type of randomFrom(customers1, customers2, customers3) to choose a population to put the new agents in? Do you first put the customers1...3 in a collection (three in all) or a list? OR how would you just merely choose randomly from a few items? I know there is the randomlyCreate function that allows you to randomly create agents of different types for a list, but i cant find a function that will randomly choose something from a list i create either of the same type of object or a completely random list.




Aucun commentaire:

Enregistrer un commentaire