(gen, clients, clockRange)
| 393 | * @param {number} clockRange (max clock - exclusive - by each client) |
| 394 | */ |
| 395 | export const createRandomIdSet = (gen, clients, clockRange) => { |
| 396 | const maxOpLen = 5 |
| 397 | const numOfOps = math.ceil((clients * clockRange) / maxOpLen) |
| 398 | const idset = createIdSet() |
| 399 | for (let i = 0; i < numOfOps; i++) { |
| 400 | const client = prng.uint32(gen, 0, clients - 1) |
| 401 | const clockStart = prng.uint32(gen, 0, clockRange) |
| 402 | const len = prng.uint32(gen, 0, clockRange - clockStart) |
| 403 | addToIdSet(idset, client, clockStart, len) |
| 404 | } |
| 405 | if (idset.clients.size === clients && clients > 1 && prng.bool(gen)) { |
| 406 | idset.clients.delete(prng.uint32(gen, 0, clients)) |
| 407 | } |
| 408 | return idset |
| 409 | } |
| 410 | |
| 411 | /** |
| 412 | * @template T |
no test coverage detected
searching dependent graphs…