pool

package
v0.16.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2026 License: Apache-2.0 Imports: 0 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package pool will hold pool-generation algorithms extracted from internal/helper. Stub created to unblock Slice 1 partial round-robin work (NFR-001, US11).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Match

type Match struct {
	SideA *Player
	SideB *Player
}

Match is a single head-to-head fixture between two players inside a pool. SideA/SideB point into the Player slice passed to the generator so callers can correlate match results back to the original entries.

func GenerateAdjacentPairings

func GenerateAdjacentPairings(players []Player) []Match

GenerateAdjacentPairings produces a partial round-robin: each player faces only their immediate neighbour in the input order. For N players the result is N-1 matches in the sequence (0,1), (1,2), ..., (N-2,N-1).

Use case (FR-052, R7): "league" / "partial-pool" competitions where a full round-robin would be too long; participants get a guaranteed pair of bouts (one with the player above, one with the player below) plus the two end-players who only get one. The list ordering is therefore load-bearing — the caller (Slice 1.D / Slice 6) is responsible for sorting by rank/seed before invoking this.

Returns nil when fewer than 2 players are passed (no valid pairing).

type Player

type Player struct {
	ID string
}

Player is the minimal pool-scoped player identity. The wider Player type with name/dojo/grade lives in internal/helper for Excel-rendering reasons; this struct deliberately stays small so pool generation can be tested in isolation (NFR-001, NFR-007 incremental adoption).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL