Skip to content

Main content

Random Booking Occupancy Dataset Generator

Construct synthetic half-open day reservations within resource capacity, with daily occupancy, overlap evidence, and optional labeled over-capacity controls.

Loading tool…

Description

Construct synthetic half-open day reservations within resource capacity, with daily occupancy, overlap evidence, and optional labeled over-capacity controls.

A workflow or scheduling fixture makes ordering, dependencies, capacity, and timing explicit. Returning both the constructed records and their checks helps consumers distinguish a valid arrangement from a simulated failure case.

Construct synthetic half-open day reservations within resource capacity, with daily occupancy, overlap evidence, and optional labeled over-capacity controls.

When to use this tool

Use this generator to create reproducible booking occupancy 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

  1. Supply resources, startDate, endDateExclusive, count, minimumDurationDays, maximumDurationDays, includeOverlapControl 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 reservations, occupancy, overlappingPairs, controls. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.

Expand each resource capacity into independent unit lanes and assign sampled positive-length reservations in forward lane order, reserving enough future slots for count. Calculate per-day occupancy and overlapping reservation pairs; optionally return a separate deliberately over-capacity control.1

Input fieldMeaning and unitsAccepted input
resourcesResourcesRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 32.
resources[].idLiteral identifier used independently of display labels.Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 128.
resources[].capacityCapacityRequired. Safe integer; minimum 1; maximum 128.
startDateStart DateRequired. Text.
endDateExclusiveEnd Date ExclusiveRequired. Text.
countCountRequired. Safe integer; minimum 1; maximum 128.
minimumDurationDaysMinimum Duration DaysRequired. Safe integer; minimum 1.
maximumDurationDaysMaximum Duration DaysRequired. Safe integer; minimum 1.
includeOverlapControlInclude Overlap ControlRequired. Boolean.
seedOptional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed.Optional. Safe integer.
Output fieldInterpretationReturned shape
reservationsReservationsRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 128.
reservations[].idLiteral identifier used independently of display labels.Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 128.
reservations[].resourceIdResource IdRequired. Text; minimum UTF-16 length 1; maximum UTF-16 length 128.
reservations[].laneLaneRequired. Safe integer.
reservations[].startDateStart DateRequired. Text.
reservations[].endDateExclusiveEnd Date ExclusiveRequired. Text.
reservations[].durationDaysDuration DaysRequired. Safe integer.
reservations[].unitsUnitsRequired. Safe integer.
occupancyOccupancyRequired. Array of Object; no unknown keys.; minimum items 0; maximum items 4096.
occupancy[].resourceIdResource IdRequired. Text; minimum UTF-16 length 1; maximum UTF-16 length 128.
occupancy[].dateDateRequired. Text.
occupancy[].unitsUnitsRequired. Safe integer.
occupancy[].capacityCapacityRequired. Safe integer.
overlappingPairsOverlapping PairsRequired. Array of Object; no unknown keys.; minimum items 0; maximum items 8128.
overlappingPairs[].firstIdFirst IdRequired. Text; minimum UTF-16 length 1; maximum UTF-16 length 128.
overlappingPairs[].secondIdSecond IdRequired. Text; minimum UTF-16 length 1; maximum UTF-16 length 128.
controlsControlsRequired. Array of Object; no unknown keys.; minimum items 0; maximum items 1.
controls[].resourceIdResource IdRequired. Text; minimum UTF-16 length 1; maximum UTF-16 length 128.
controls[].startDateStart DateRequired. Text.
controls[].endDateExclusiveEnd Date ExclusiveRequired. Text.
controls[].unitsUnitsRequired. Safe integer.
controls[].exceedsCapacityExceeds CapacityRequired. Boolean.
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": {
    "resources": [
      {
        "id": "room",
        "capacity": 2
      }
    ],
    "startDate": "2024-02-27",
    "endDateExclusive": "2024-03-01",
    "count": 2,
    "minimumDurationDays": 2,
    "maximumDurationDays": 2,
    "includeOverlapControl": true,
    "seed": 42
  },
  "output": {
    "reservations": [
      {
        "id": "booking-1",
        "resourceId": "room",
        "lane": 1,
        "startDate": "2024-02-28",
        "endDateExclusive": "2024-03-01",
        "durationDays": 2,
        "units": 1
      },
      {
        "id": "booking-2",
        "resourceId": "room",
        "lane": 0,
        "startDate": "2024-02-28",
        "endDateExclusive": "2024-03-01",
        "durationDays": 2,
        "units": 1
      }
    ],
    "occupancy": [
      {
        "resourceId": "room",
        "date": "2024-02-27",
        "units": 0,
        "capacity": 2
      },
      {
        "resourceId": "room",
        "date": "2024-02-28",
        "units": 2,
        "capacity": 2
      },
      {
        "resourceId": "room",
        "date": "2024-02-29",
        "units": 2,
        "capacity": 2
      }
    ],
    "overlappingPairs": [
      {
        "firstId": "booking-1",
        "secondId": "booking-2"
      }
    ],
    "controls": [
      {
        "resourceId": "room",
        "startDate": "2024-02-28",
        "endDateExclusive": "2024-03-01",
        "units": 3,
        "exceedsCapacity": true
      }
    ],
    "randomness": {
      "seed": 42,
      "source": "seed"
    }
  }
}

Limitations and assumptions

  • Overlapping bookings on different lanes can be valid when total units fit capacity. The control is not added to the valid reservations. Dates are half-open plain-date intervals and no reservation system is contacted.
  • 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 Booking Occupancy Dataset Generator — tool.io

Similar or alternative tools

  • Calendar Overlap and Common Gap Finder

    Compare bounded supplied busy calendars over an explicit half-open epoch-millisecond window, deduplicating same-calendar overlap and delegating interval cells to report common gaps, overlaps and per-calendar occupied duration.

  • Random Assessment Item Sampler Generator

    Sample distinct existing question records without replacement within each requested objective count, shuffle the combined paper, and delegate coverage auditing against a caller-selected minimum. Entire supplied prompts and answers are retained unchanged; extra bank objectives are ignored, shortages fail explicitly, and no assessment-validity or difficulty claim is made.