Skip to content

Main content

Random FIFO Inventory Transaction Trace Generator

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.

Loading tool…

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

  1. Supply initialQuantities, minimumReceipt, maximumReceipt, receiptProbability, eventCount in the field shapes below. Set seed when you need an explicit replay.
  2. 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.
  3. 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 fieldMeaning and unitsAccepted input
initialQuantitiesInitial QuantitiesRequired. Array of Safe integer; minimum 1; maximum 9007199254740991.; maximum items 16.
minimumReceiptMinimum ReceiptRequired. Safe integer; minimum 1; maximum 9007199254740991.
maximumReceiptMaximum ReceiptRequired. Safe integer; minimum 1; maximum 9007199254740991.
receiptProbabilityReceipt ProbabilityRequired. Finite number; minimum 0; maximum 1.
eventCountEvent CountRequired. Safe integer; minimum 1; maximum 128.
seedOptional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed.Optional. Safe integer.
Output fieldInterpretationReturned shape
initialLayersInitial LayersRequired. Array of Object; no unknown keys.; maximum items 144.
initialLayers[].layerIdLayer IdRequired. Text.
initialLayers[].remainingUnitsRemaining UnitsRequired. Safe integer; minimum 1; maximum 9007199254740991.
eventsEventsRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 128.
events[].indexIndexRequired. Safe integer; minimum 1; maximum 128.
events[].kindKindRequired. Text; one of "receipt", "issue".
events[].quantityQuantityRequired. Safe integer; minimum 1; maximum 9007199254740991.
events[].receiptLayerIdReceipt Layer IdRequired. Text. or Null.
events[].stockBeforeStock BeforeRequired. Safe integer; minimum 0; maximum 9007199254740991.
events[].stockAfterStock AfterRequired. Safe integer; minimum 0; maximum 9007199254740991.
events[].consumptionConsumptionRequired. Array of Object; no unknown keys.; maximum items 144.
events[].consumption[].layerIdLayer IdRequired. Text.
events[].consumption[].unitsUnitsRequired. Safe integer; minimum 1; maximum 9007199254740991.
events[].layersLayersRequired. Array of Object; no unknown keys.; maximum items 144.
events[].layers[].layerIdLayer IdRequired. Text.
events[].layers[].remainingUnitsRemaining UnitsRequired. Safe integer; minimum 1; maximum 9007199254740991.
finalLayersFinal LayersRequired. Array of Object; no unknown keys.; maximum items 144.
finalLayers[].layerIdLayer IdRequired. Text.
finalLayers[].remainingUnitsRemaining UnitsRequired. Safe integer; minimum 1; maximum 9007199254740991.
randomnessReplay source and normalized 32-bit seed, or null seed for an advancing context source.Required. Object; no unknown keys.
randomness.seedOptional safe-integer replay seed; normalization and precedence are explained below.Required. Safe integer. or Null.
randomness.sourceSourceRequired. 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.

json
{
  "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

  1. Tool behavior and example: Random FIFO Inventory Transaction Trace Generator — tool.io

  2. Calculation or validation: logistics/fifo-layer-remaining-quantity-tracker — tool.io

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.