Agent top(population, value) - Returns agent having maximum value in given population.

Example: Person person = top( people, p ->
p.age );

Here we get the oldest person from the population people. If the population is empty, the function returns null.

List filter(population, condition) - Returns a subset of a given population - a new list with agents from the original population which meet the given condition.

Examples: List women = filter( people, p ->
p.gender == FEMALE );

List idleTrucks = filter( trucks, t -> t.inState(Idle) );

List idleTrucks = filter( trucks, t -> t.inState(Idle) );

List findAll(population, condition) - This function is the same as filter(population, condition).

Agent findFirst(population, condition) - Returns the first agent from the given population which meets the given condition (the element which has true value of the given condition). Returns null if there is no such element or the collection is empty.

Example: Person person = findFirst( people, p -> p.age > 20 );