generateLinearSetBinFrom

fun generateLinearSetBinFrom(level: Int, size: Int, generator: (Int) -> A_BasicObject): AvailObject

Generate a linear set bin by extracting the specified number of values from the generator. The values might not necessarily be unique, so reduce them. If they are all the same value, answer the value itself as a singleton bin.

Each element is compared against all the others to detect duplicates while populating the bin. If any duplicates are detected, a copy is made of the populated prefix of the bin.

Return

A top-level linear set bin.

Parameters

level

The level of the bin to create.

size

The number of values to extract from the generator.

generator

A generator to provide AvailObjects to store.