Description
Generate chronological synthetic receipts and stock-limited issues, retain an explicit FIFO layer queue, and delegate consumption of each oldest layer. Empty stock forces a receipt without an event-type draw; no issues exceed stock, depleted layers disappear, and this quantity-only trace models neither prices nor real inventory transactions.
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 chronological synthetic receipts and stock-limited issues, retain an explicit FIFO layer queue, and delegate consumption of each oldest layer. Empty stock forces a receipt without an event-type draw; no issues exceed stock, depleted layers disappear, and this quantity-only trace models neither prices nor real inventory transactions.
When to use this tool
Use this generator to create reproducible fifo inventory transaction trace 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 initialQuantities, minimumReceipt, maximumReceipt, receiptProbability, eventCount 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 initialLayers, events, finalLayers. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.
Maintain FIFO receipt layers and sample receipts or stock-limited issues, forcing a receipt when stock is empty. Consume issues from the oldest layer using the existing layer tracker and retain per-layer consumption, stock totals, and snapshots.1
Delegated operations used for this result: fifo layer remaining quantity tracker. Their calculation or parsing conventions apply to the corresponding result fields.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| initialQuantities | Initial Quantities | Required. Array of Safe integer; minimum 1; maximum 9007199254740991.; maximum items 16. |
| minimumReceipt | Minimum Receipt | Required. Safe integer; minimum 1; maximum 9007199254740991. |
| maximumReceipt | Maximum Receipt | Required. Safe integer; minimum 1; maximum 9007199254740991. |
| receiptProbability | Receipt Probability | Required. Finite number; minimum 0; maximum 1. |
| eventCount | Event Count | 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 |
|---|---|---|
| initialLayers | Initial Layers | Required. Array of Object; no unknown keys.; maximum items 144. |
| initialLayers[].layerId | Layer Id | Required. Text. |
| initialLayers[].remainingUnits | Remaining Units | Required. Safe integer; minimum 1; maximum 9007199254740991. |
| events | Events | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 128. |
| events[].index | Index | Required. Safe integer; minimum 1; maximum 128. |
| events[].kind | Kind | Required. Text; one of "receipt", "issue". |
| events[].quantity | Quantity | Required. Safe integer; minimum 1; maximum 9007199254740991. |
| events[].receiptLayerId | Receipt Layer Id | Required. Text. or Null. |
| events[].stockBefore | Stock Before | Required. Safe integer; minimum 0; maximum 9007199254740991. |
| events[].stockAfter | Stock After | Required. Safe integer; minimum 0; maximum 9007199254740991. |
| events[].consumption | Consumption | Required. Array of Object; no unknown keys.; maximum items 144. |
| events[].consumption[].layerId | Layer Id | Required. Text. |
| events[].consumption[].units | Units | Required. Safe integer; minimum 1; maximum 9007199254740991. |
| events[].layers | Layers | Required. Array of Object; no unknown keys.; maximum items 144. |
| events[].layers[].layerId | Layer Id | Required. Text. |
| events[].layers[].remainingUnits | Remaining Units | Required. Safe integer; minimum 1; maximum 9007199254740991. |
| finalLayers | Final Layers | Required. Array of Object; no unknown keys.; maximum items 144. |
| finalLayers[].layerId | Layer Id | Required. Text. |
| finalLayers[].remainingUnits | Remaining Units | Required. Safe integer; minimum 1; maximum 9007199254740991. |
| randomness | Replay source and normalized 32-bit seed, or null seed for an advancing context source. | Required. Object; no unknown keys. |
| randomness.seed | Optional safe-integer 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": {
"initialQuantities": [
3,
2
],
"minimumReceipt": 1,
"maximumReceipt": 4,
"receiptProbability": 0.4,
"eventCount": 6,
"seed": 42
},
"output": {
"initialLayers": [
{
"layerId": "initial-1",
"remainingUnits": 3
},
{
"layerId": "initial-2",
"remainingUnits": 2
}
],
"events": [
{
"index": 1,
"kind": "issue",
"quantity": 3,
"receiptLayerId": null,
"stockBefore": 5,
"stockAfter": 2,
"consumption": [
{
"layerId": "initial-1",
"units": 3
}
],
"layers": [
{
"layerId": "initial-2",
"remainingUnits": 2
}
]
},
{
"index": 2,
"kind": "issue",
"quantity": 2,
"receiptLayerId": null,
"stockBefore": 2,
"stockAfter": 0,
"consumption": [
{
"layerId": "initial-2",
"units": 2
}
],
"layers": []
},
{
"index": 3,
"kind": "receipt",
"quantity": 1,
"receiptLayerId": "receipt-1",
"stockBefore": 0,
"stockAfter": 1,
"consumption": [],
"layers": [
{
"layerId": "receipt-1",
"remainingUnits": 1
}
]
},
{
"index": 4,
"kind": "issue",
"quantity": 1,
"receiptLayerId": null,
"stockBefore": 1,
"stockAfter": 0,
"consumption": [
{
"layerId": "receipt-1",
"units": 1
}
],
"layers": []
},
{
"index": 5,
"kind": "receipt",
"quantity": 3,
"receiptLayerId": "receipt-2",
"stockBefore": 0,
"stockAfter": 3,
"consumption": [],
"layers": [
{
"layerId": "receipt-2",
"remainingUnits": 3
}
]
},
{
"index": 6,
"kind": "issue",
"quantity": 2,
"receiptLayerId": null,
"stockBefore": 3,
"stockAfter": 1,
"consumption": [
{
"layerId": "receipt-2",
"units": 2
}
],
"layers": [
{
"layerId": "receipt-2",
"remainingUnits": 1
}
]
}
],
"finalLayers": [
{
"layerId": "receipt-2",
"remainingUnits": 1
}
],
"randomness": {
"seed": 42,
"source": "seed"
}
}
} Limitations and assumptions
- Quantities track units rather than monetary valuation. No negative inventory or backorders are generated. The trace does not model expiry, physical picking, taxation, or financial FIFO accounting.
- A replay requires the same complete input and implementation. The stated sampling convention applies within its eligible space. A finite draw does not exhaust all possible outputs; repeats remain possible unless a distinct-selection rule is explicit.
- 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 Delivery Attempt Outcome Dataset Generator
Generate synthetic stops with capped retry attempts, explicit first/later success probabilities and integer minor-unit attempt costs; stop attempts after success and delegate first-attempt rate and cost per completed drop. Cost includes failed attempts and failed stops, uses one supplied currency/unit convention, and is undefined when no drops complete; no real-route prediction is implied.
- Two-Table Cuckoo Hashing Trace Tool
Trace insertion evictions, lookups and deletion in two fixed-size integer-key cuckoo tables using h1(k)=k mod m and h2(k)=floor(k/m) mod m; a kick limit rolls back the insertion and signals rehash-needed, without automatic resizing or hash-quality guarantees.