Companion

Properties

Link copied to clipboard
const val UNKNOWN: String

Functions

Link copied to clipboard
fun of(weights: Map<String, Long>, unknown: Long): Belief

The known ids by weight in sorted order, then UNKNOWN with exactly unknown.

Link copied to clipboard
fun share(weights: List<Long>, total: Long = FixedPoint.ONE): List<Long>

Splits total over weights in proportion, by the largest-remainder method: each share is floored, then the units left over go to the largest remainders, the earlier index first on a tie. The shares sum to exactly total and none is negative.