Queue Insert Admission Count
Apply one bounded queue insertion request, retaining admitted/rejected counts and new occupancy; no concurrency or queueing forecast.
Description
Apply one bounded queue insertion request, retaining admitted/rejected counts and new occupancy; no concurrency or queueing forecast.
A bounded queue admits only requests that fit its remaining slots under an all-identical-slot model.
When to use this tool
Apply one bounded queue insertion request, retaining admitted/rejected counts and new occupancy; no concurrency or queueing forecast.
- Prepare the supplied capacity, occupied, requested fields for this operation.
- Compare the complete example with the representation used by your own input before carrying the result into another step.
How to use the tool and how it works
- Enter capacity, occupied, requested. Use the exact text syntax, units and index conventions explained below.
- Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
- Read result.admitted, result.rejected, result.occupied. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Validate nonnegative integer capacity and requested with occupied within capacity. admitted is min(requested, capacity minus occupied); return rejected and the updated occupied count.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| capacity | capacity. | Integer from 0 to 1e9 inclusive |
| occupied | occupied. | Integer from 0 to capacity inclusive |
| requested | requested. | Integer from 0 to 1e9 inclusive |
| Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.admitted | The admitted value under the stated formula or text convention. |
| result.rejected | The rejected value under the stated formula or text convention. |
| result.occupied | The occupied value under the stated formula or text convention. |
{
"input": {
"capacity": 10,
"occupied": 7,
"requested": 5
},
"output": {
"result": {
"admitted": 3,
"rejected": 2,
"occupied": 10
}
}
} Limitations and assumptions
- No actual queue is modified. Priority, item size and concurrent arrivals are outside the model.
- All declared input fields are required and unexpected top-level fields are rejected. Numbers must be finite; lists are limited to 128 entries and ordinary text fields to 8,192 UTF-16 code units, with tighter limits where stated.
- JSON text inputs must parse within bounded nesting and size limits. Numeric outputs outside the safe finite range are rejected; large exact integer results use decimal strings. Indexes and half-open spans are zero-based unless a rank is explicitly described as one-based.
Alternative or Complementary methods
Check the arithmetic against the actual scheduling or storage policy. Add variable costs, arrivals, concurrent state and overhead in a model that explicitly represents them when they affect the decision.
References
Similar or alternative tools
- Per Item Prefix Capacity Admission
Admit only the longest affordable ordered prefix of explicit per-item costs; after the first failure later cheaper items are not skipped into admission.
- Queue Drain Remainder Count
Apply an explicit queue drain request with bounded available items; retain unfulfilled count instead of permitting negative occupancy.