diff options
author | Sven M. Hallberg <pesco@khjk.org> | 2023-04-10 20:07:22 +0200 |
---|---|---|
committer | Sven M. Hallberg <pesco@khjk.org> | 2023-04-10 20:07:22 +0200 |
commit | aaf716b690b23fcde0bccaf8d0a6afb1bd7b5cf5 (patch) | |
tree | dba21a9946e6ab4906c4216cf8c62fe60f4e2ce7 /go.sum | |
parent | 7cc6f9372271cd6c19af5d8d3c8a459495f3e196 (diff) |
place bots fairly
The trick is to consider not the final offsets at first, but the places between the free bytes. Select one for each bot uniformly at random; a heap is an appropriate data structure to store them. Pick a random permuation for the order of the bots and iterate over the positions from start to end. Compute the eventual offsets by adding to each the amount of space allocated so far. Thus we obtain any possible placement all over the available memory without bias.
Diffstat (limited to 'go.sum')
0 files changed, 0 insertions, 0 deletions