invigcalc

package
v1.229.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: BSD-3-Clause Imports: 4 Imported by: ? 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 invigcalc computes the fair distribution of invigilation duties: given the total invigilation minutes to cover and each invigilator's factor and already-credited contributions, it derives the per-invigilator target minutes (factor-weighted, with largest-remainder rounding so the targets sum exactly to the work) and the per-invigilator todo summary. These are pure functions over graph/model types with no I/O, split out of the plexams package so the correctness-critical math is isolated and unit-tested.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FairTargets

func FairTargets(workMinutes int, reqs []*model.Invigilator) (
	todoPerInvigilator, countedContributions int,
	targets map[int]int, enough map[int]bool,
)

FairTargets computes the factor-weighted invigilation minutes each invigilator should be planned for, given workMinutes (= SumExamRooms + SumReserve) of actual invigilation that must be covered and the already credited other contributions (Beisitz, Live-Coding, Master, ...) of every invigilator.

It solves

Σ_active max(0, T·Factor_i − contributions_i) = workMinutes

as a fixed point: an invigilator whose contributions already reach or exceed their share (T·Factor_i) does no invigilation, so they drop out of *both* numerator and denominator. Their over-contribution is "Schicksal" -- it cannot be redistributed because only the workMinutes that actually exist can be shared. Removing such an invigilator only raises T (and thus the threshold), so the active set shrinks monotonically and the loop converges in at most len(reqs) rounds.

It returns:

  • todoPerInvigilator: the fair T, rounded to the nearest integer (display value only).
  • countedContributions: the contributions of the still-active invigilators,
  • targets: the integer invigilation minutes each invigilator (by teacher ID) should be planned for, net of their other contributions. The float shares T·Factor_i − contributions_i sum to exactly workMinutes; they are rounded to integers with the largest-remainder method so the *sum of targets stays exactly workMinutes*.
  • enough: invigilators who already contributed at least their fair share and therefore do no invigilation (target 0).

func Todos

func Todos(invigilations []*model.Invigilation, totalMinutes int, enough bool) *model.InvigilatorTodos

Todos builds the per-invigilator todos: the credited doingMinutes (self invigilations count 0, reserves a fixed 60 min, see SumReserve), the set of invigilation days and the given fair target.

Types

This section is empty.

Jump to

Keyboard shortcuts

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