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
- Supply resources, startDate, endDateExclusive, count, minimumDurationDays, maximumDurationDays, includeOverlapControl 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 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 field | Meaning and units | Accepted input |
|---|---|---|
| resources | Resources | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 32. |
| resources[].id | Literal identifier used independently of display labels. | Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 128. |
| resources[].capacity | Capacity | Required. Safe integer; minimum 1; maximum 128. |
| startDate | Start Date | Required. Text. |
| endDateExclusive | End Date Exclusive | Required. Text. |
| count | Count | Required. Safe integer; minimum 1; maximum 128. |
| minimumDurationDays | Minimum Duration Days | Required. Safe integer; minimum 1. |
| maximumDurationDays | Maximum Duration Days | Required. Safe integer; minimum 1. |
| includeOverlapControl | Include Overlap Control | Required. Boolean. |
| 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 |
|---|---|---|
| reservations | Reservations | Required. Array of Object; no unknown keys.; minimum items 1; maximum items 128. |
| reservations[].id | Literal identifier used independently of display labels. | Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 128. |
| reservations[].resourceId | Resource Id | Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 128. |
| reservations[].lane | Lane | Required. Safe integer. |
| reservations[].startDate | Start Date | Required. Text. |
| reservations[].endDateExclusive | End Date Exclusive | Required. Text. |
| reservations[].durationDays | Duration Days | Required. Safe integer. |
| reservations[].units | Units | Required. Safe integer. |
| occupancy | Occupancy | Required. Array of Object; no unknown keys.; minimum items 0; maximum items 4096. |
| occupancy[].resourceId | Resource Id | Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 128. |
| occupancy[].date | Date | Required. Text. |
| occupancy[].units | Units | Required. Safe integer. |
| occupancy[].capacity | Capacity | Required. Safe integer. |
| overlappingPairs | Overlapping Pairs | Required. Array of Object; no unknown keys.; minimum items 0; maximum items 8128. |
| overlappingPairs[].firstId | First Id | Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 128. |
| overlappingPairs[].secondId | Second Id | Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 128. |
| controls | Controls | Required. Array of Object; no unknown keys.; minimum items 0; maximum items 1. |
| controls[].resourceId | Resource Id | Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 128. |
| controls[].startDate | Start Date | Required. Text. |
| controls[].endDateExclusive | End Date Exclusive | Required. Text. |
| controls[].units | Units | Required. Safe integer. |
| controls[].exceedsCapacity | Exceeds Capacity | Required. Boolean. |
| 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": {
"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
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.