package urn

  1. Overview
  2. Docs

Module UrnSource

Urns for weighted random sampling.

This module implements the urn data structure given a weight type that is a totally ordered group with a random sampling function.

Sourcemodule type WeightType = sig ... end

Input signature of the functor Make.

Sourcemodule type U = sig ... end

Output signature of the functor Make.

Sourcemodule Make (Weight : WeightType) : U with type weight = Weight.t

Functor building an implementation of the urn structure given a weight type.

Sourcemodule IntWeight : WeightType with type t = int

A module for int weights using Random.int to sample random integers.

Sourcemodule FloatWeight : WeightType with type t = float

A module for float weights using Random.float to sample random floating point numbers.