Description
Generate synthetic book quantities and signed count deltas, clamp negative physical counts explicitly at zero, and delegate inventory-loss units and percentages. Overage remains negative shrinkage; zero book quantity has an undefined percentage with an explicit reason, not a fabricated zero, and values are not evidence about actual inventory.
A logistics test dataset combines supplied operating ranges with explicit quantity and unit conventions. Constructed measurements and calculated indicators can exercise reports and calculators without claiming to represent an observed operation or a safe physical plan.
Generate synthetic book quantities and signed count deltas, clamp negative physical counts explicitly at zero, and delegate inventory-loss units and percentages. Overage remains negative shrinkage; zero book quantity has an undefined percentage with an explicit reason, not a fabricated zero, and values are not evidence about actual inventory.
When to use this tool
Use this generator to create reproducible inventory shrinkage audit dataset cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.
How to use the tool and how it works
- Supply minimumBookUnits, maximumBookUnits, minimumDelta, maximumDelta, count in the field shapes below. Set seed when you need an explicit replay.
- Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
- Read rows. Use the conventions below and keep answer-bearing fields separate when presenting an exercise.
Draw book inventory and a signed requested delta, clamp resulting physical count at zero, and delegate shrinkage for positive book counts. For zero book inventory, retain unitsLost as minus physical count and return null percentage with an explicit reason.1
Delegated operations used for this result: shrinkage percent inventory loss. Their calculation or parsing conventions apply to the corresponding result fields.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| minimumBookUnits | Minimum Book Units | Required. Safe integer; minimum 0; maximum 9007199254740991. |
| maximumBookUnits | Maximum Book Units | Required. Safe integer; minimum 0; maximum 9007199254740991. |
| minimumDelta | Minimum Delta | Required. Safe integer; minimum -9007199254740991; maximum 9007199254740991. |
| maximumDelta | Maximum Delta | Required. Safe integer; minimum -9007199254740991; maximum 9007199254740991. |
| count | Requested count; the mechanics explain whether one draw expands into several returned records. | Required. Safe integer; minimum 1; maximum 128. |
| seed | Optional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed. | Optional. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| rows | Rows | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 128. |
| rows[].id | Literal identifier used to match records, independently of their display labels. | Required. Text. |
| rows[].bookInventoryUnits | Book Inventory Units | Required. Safe integer; minimum 0; maximum 9007199254740991. |
| rows[].requestedDelta | Requested Delta | Required. Safe integer; minimum -9007199254740991; maximum 9007199254740991. |
| rows[].physicalCountUnits | Physical Count Units | Required. Safe integer; minimum 0; maximum 9007199254740991. |
| rows[].clampedAtZero | Clamped At Zero | Required. Boolean. |
| rows[].unitsLost | Units Lost | Required. Safe integer; minimum -9007199254740991; maximum 9007199254740991. |
| rows[].shrinkagePercent | Shrinkage Percent | Required. Finite number. or Null. |
| rows[].undefinedReason | Undefined Reason | Required. Text; exactly "zero-book-inventory". or Null. |
| randomness | Replay metadata: source is seed or context; seed is the normalized 32-bit seed or null for a context source. | Required. Object; no unknown keys. |
| randomness.seed | Optional numeric replay seed; normalization and precedence are explained below. | Required. Safe integer. or Null. |
| randomness.source | Source | Required. Text; one of "context", "seed". |
An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.
{
"input": {
"minimumBookUnits": 0,
"maximumBookUnits": 3,
"minimumDelta": -3,
"maximumDelta": 5,
"count": 4,
"seed": 42
},
"output": {
"rows": [
{
"id": "count-1",
"bookInventoryUnits": 2,
"requestedDelta": 1,
"physicalCountUnits": 3,
"clampedAtZero": false,
"unitsLost": -1,
"shrinkagePercent": -50,
"undefinedReason": null
},
{
"id": "count-2",
"bookInventoryUnits": 3,
"requestedDelta": 3,
"physicalCountUnits": 6,
"clampedAtZero": false,
"unitsLost": -3,
"shrinkagePercent": -100,
"undefinedReason": null
},
{
"id": "count-3",
"bookInventoryUnits": 0,
"requestedDelta": 1,
"physicalCountUnits": 1,
"clampedAtZero": false,
"unitsLost": -1,
"shrinkagePercent": null,
"undefinedReason": "zero-book-inventory"
},
{
"id": "count-4",
"bookInventoryUnits": 1,
"requestedDelta": 2,
"physicalCountUnits": 3,
"clampedAtZero": false,
"unitsLost": -2,
"shrinkagePercent": -200,
"undefinedReason": null
}
],
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- A negative shrinkage can represent a surplus. requestedDelta can differ from realized delta after clamping. These are synthetic audit rows rather than verified inventory loss, fraud evidence, or valuation.
- A replay requires the same complete input and implementation. Randomized construction does not guarantee uniform coverage of every feasible output; finite samples can repeat unless a distinct-selection rule is explicitly stated.
- The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.
Alternative or Complementary methods
For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.
References
Similar or alternative tools
- Random Inventory ABC Classification Dataset Generator
Generate positive synthetic demand and unit values in one caller-labeled value unit, rank independently by annual usage value and demand throughput, and delegate cumulative-share ABC classifications. Value policy remains the existing fixed 80/95 boundaries, velocity boundaries are explicit, ties retain item order, and classification uses the cumulative share including the current item—not a forced A class for the largest item.
- Random Inventory Forecast Error Dataset Generator
Construct nonnegative synthetic demand with selected perfect, signed-additive or multiplicative forecast patterns, retain parameters and zero-clamping, and delegate MAE plus logistics WMAPE/bias. All-zero actual demand makes WMAPE explicitly undefined, not zero; outputs preserve existing floating arithmetic and are controlled fixtures rather than forecast-quality guarantees.