AnyLogic provides functions to select a random agent from a given population. These functions are defined in the class Utilities and are global (accessible from each place of model code). You call any function from the list below by typing just its name, without a prefix with the population name: randomWhere( people, p -> p.income > 10000 );
AnyLogic provides functions to select a random element from a given collection. These functions are defined in the class Utilities and are global (accessible from each place of model code). You call any function from the list below by typing just its name, without a prefix with the collection name: randomWhere( people, p -> p.income > 10000 );
AnyLogic provides functions to select a random element from a given array. These functions are defined in the class Utilities and are global (accessible from each place of model code). You call any function from the list below by typing just its name, without a prefix with the array name: randomWhere( people, p -> p.income > 10000 );
For example, you have the option list named Gender . To randomly select one option from this option list, use one of the following functions:
To select a random standard color, one of possible 140 standard colors, use the global function java.awt.Color randomColor() .
AnyLogic provides functions to create a randomly chosen object from a given list of objects. These functions are defined in the Utilities class and are global (accessible everywhere in the model). You call any function from the list below by typing just its name, without a prefix.