# Twinworks Buffer Allocation Optimiser > Distribute a fixed number of buffer places over a line for maximum throughput. Solves the buffer allocation problem of a production line by simulation: a fixed total of buffer places (for example the floor space you have) is distributed over the buffers so that throughput is as high as possible. Greedy marginal allocation with common random numbers, compared against the current allocation with a paired confidence interval. Part of usefulweb.site (https://usefulweb.site/). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://twinworksbufferallocation.usefulweb.site/ (interactive tool at https://twinworksbufferallocation.usefulweb.site/tool) - JSON API: POST https://twinworksbufferallocation.usefulweb.site/api/v1/calculate with a JSON object of inputs (schema: https://twinworksbufferallocation.usefulweb.site/api/v1/tool) - OpenAPI: https://twinworksbufferallocation.usefulweb.site/openapi.json - MCP (Streamable HTTP): https://twinworksbufferallocation.usefulweb.site/mcp - tool `twinworks_buffer_allocation` ## Inputs - model (textarea): Model or project JSON - A Twinworks project (.twinworks.json, format "twinworks-project") or a bare model with "nodes" and "links". Times in seconds, lengths in metres. Leave empty and pick a template instead. - template (select): Or start from a template - total (integer): Total buffer places - Places to distribute over the buffers. Default: the sum of the current capacities (same space, better placement). - minCapacity (integer): Minimum per buffer - buffers (text): Buffer ids - Comma-separated ids (e.g. B1,B2,B3). Default: every buffer with a finite capacity. - replications (integer): Replications per candidate - horizonHours (number): Run length per replication - Overrides the model setting. ## Method - Every buffer starts at the minimum capacity; then, one place at a time, each buffer is tried with one more place and the place goes to the buffer with the highest mean throughput (ties: lower mean lead time). This greedy marginal allocation is the standard heuristic for the buffer allocation problem of serial lines. - All candidates use the same random-number seeds (common random numbers), so differences are caused by the allocation and not by noise; the gain over the current allocation is a paired Student-t interval. ## Limits - Greedy allocation is a heuristic: it is optimal or near-optimal for typical serial lines but not guaranteed for every network. Confirm the result with more replications in the app.