Liking cljdoc? Tell your friends :D

game.protocols.coseller-attribution

Pluggable chain-of-influence attribution for the Coseller Protocol.

weigh-chain is a multimethod dispatched on the algorithm name (a string). It turns a buyer's touches into an ordered chain of cosellers with relative weights. allocate then distributes an integer pool across those weights using the largest-remainder method so the splits always sum exactly to the pool — no rounding drift, no minted or lost units.

Adding a new attribution model = one new defmethod weigh-chain plus a new value the GM may set as :algorithm on the policy. Nothing else changes.

Pluggable chain-of-influence attribution for the Coseller Protocol.

`weigh-chain` is a multimethod dispatched on the algorithm name (a string).
It turns a buyer's touches into an ordered chain of cosellers with relative
weights. `allocate` then distributes an integer pool across those weights
using the largest-remainder method so the splits always sum exactly to the
pool — no rounding drift, no minted or lost units.

Adding a new attribution model = one new `defmethod weigh-chain` plus a new
value the GM may set as `:algorithm` on the policy. Nothing else changes.
raw docstring

algorithmsclj

The set of registered attribution algorithm names.

The set of registered attribution algorithm names.
raw docstring

allocateclj

(allocate pool weights)

Distribute the integer pool across weights (a seq of [coseller weight]) using the largest-remainder method, so the integer splits always sum exactly to pool. Ties on the fractional remainder break toward earlier entries (stable, chain order). Returns {coseller {:amount <int> :weight-bps <int>}}. Empty weights, non-positive total weight, or a non-positive pool yield {}.

Distribute the integer `pool` across `weights` (a seq of `[coseller weight]`)
using the largest-remainder method, so the integer splits always sum exactly
to `pool`. Ties on the fractional remainder break toward earlier entries
(stable, chain order). Returns `{coseller {:amount <int> :weight-bps <int>}}`.
Empty weights, non-positive total weight, or a non-positive pool yield `{}`.
raw docstring

registered?clj

(registered? algorithm)

weigh-chaincljmultimethod

Given an algorithm name and a context map {:touches :as-of :window-days}, return an ordered vector of [coseller weight] pairs — the eligible chain-of-influence in influence order. Distinct cosellers only; weights are relative (not currency amounts).

Given an algorithm name and a context map `{:touches :as-of :window-days}`,
return an ordered vector of `[coseller weight]` pairs — the eligible
chain-of-influence in influence order. Distinct cosellers only; weights are
relative (not currency amounts).
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close