{
  "node": {
    "id": "block:site-power-allocator",
    "type": "Block",
    "label": "Shared site power allocator",
    "properties": {
      "id": "site-power-allocator",
      "name": "Shared site power allocator",
      "kind": "studio",
      "summary": "Share one grid-side power budget among one to eight requests.",
      "behavior": "Proportional allocation scales all nonnegative demands together. Input-priority allocation fills request 1 before request 2 and subsequent requests. It outputs allocated power for each configured input plus total demand, total allocation and unused power.",
      "ports": [
        {
          "name": "limit",
          "direction": "input",
          "unit": "W",
          "description": "Typed signal input; its quantity must match the connected output."
        },
        {
          "name": "demand1",
          "direction": "input",
          "unit": "W",
          "description": "Nonnegative request. Only demand1 through the configured ports count may be connected."
        },
        {
          "name": "demand2",
          "direction": "input",
          "unit": "W",
          "description": "Nonnegative request. Only demand1 through the configured ports count may be connected."
        },
        {
          "name": "demand3",
          "direction": "input",
          "unit": "W",
          "description": "Nonnegative request. Only demand1 through the configured ports count may be connected."
        },
        {
          "name": "demand4",
          "direction": "input",
          "unit": "W",
          "description": "Nonnegative request. Only demand1 through the configured ports count may be connected."
        },
        {
          "name": "demand5",
          "direction": "input",
          "unit": "W",
          "description": "Nonnegative request. Only demand1 through the configured ports count may be connected."
        },
        {
          "name": "demand6",
          "direction": "input",
          "unit": "W",
          "description": "Nonnegative request. Only demand1 through the configured ports count may be connected."
        },
        {
          "name": "demand7",
          "direction": "input",
          "unit": "W",
          "description": "Nonnegative request. Only demand1 through the configured ports count may be connected."
        },
        {
          "name": "demand8",
          "direction": "input",
          "unit": "W",
          "description": "Nonnegative request. Only demand1 through the configured ports count may be connected."
        },
        {
          "name": "totalDemand",
          "direction": "output",
          "unit": "W",
          "description": "Observed result from the solved component or sampled controller."
        },
        {
          "name": "totalAllocated",
          "direction": "output",
          "unit": "W",
          "description": "Observed result from the solved component or sampled controller."
        },
        {
          "name": "unusedPower",
          "direction": "output",
          "unit": "W",
          "description": "Observed result from the solved component or sampled controller."
        },
        {
          "name": "allocation1",
          "direction": "output",
          "unit": "W",
          "description": "Allocated power; outputs exist through the configured ports count."
        },
        {
          "name": "allocation2",
          "direction": "output",
          "unit": "W",
          "description": "Allocated power; outputs exist through the configured ports count."
        },
        {
          "name": "allocation3",
          "direction": "output",
          "unit": "W",
          "description": "Allocated power; outputs exist through the configured ports count."
        },
        {
          "name": "allocation4",
          "direction": "output",
          "unit": "W",
          "description": "Allocated power; outputs exist through the configured ports count."
        },
        {
          "name": "allocation5",
          "direction": "output",
          "unit": "W",
          "description": "Allocated power; outputs exist through the configured ports count."
        },
        {
          "name": "allocation6",
          "direction": "output",
          "unit": "W",
          "description": "Allocated power; outputs exist through the configured ports count."
        },
        {
          "name": "allocation7",
          "direction": "output",
          "unit": "W",
          "description": "Allocated power; outputs exist through the configured ports count."
        },
        {
          "name": "allocation8",
          "direction": "output",
          "unit": "W",
          "description": "Allocated power; outputs exist through the configured ports count."
        }
      ],
      "parameters": [
        {
          "key": "ports",
          "label": "Ports",
          "unit": "count",
          "default": 2,
          "min": 1,
          "max": 8,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "limitW",
          "label": "Limit W",
          "unit": "W grid-side",
          "default": 11000,
          "min": 0,
          "max": 1000000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "allocation",
          "label": "Allocation",
          "unit": "0 proportional, 1 input priority",
          "default": 0,
          "min": 0,
          "max": 1,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        }
      ],
      "equations": [
        "P_i = max(0, demand_i) * min(1, P_limit / sum(max(0, demand_j))), when total demand > 0"
      ],
      "example": {
        "title": "Compare charging policies",
        "text": "Connect a vehicle for eight hours with a cheaper window from hour 1 to hour 7.",
        "url": "https://design.lemonergy.com/cosim.html?example=charging-home",
        "label": "Open the Studio example"
      },
      "limits": [
        "This is deterministic policy comparison, not a forecast or economic optimum.",
        "Downstream unused capacity is not silently redistributed."
      ],
      "evidence": [
        "js/charging-control.js",
        "js/charging-scenarios.js",
        "docs/CHARGING_BLOCKS_SPEC.md",
        "js/physical-network.js",
        "rust-core/src/charging_control.rs"
      ],
      "caseIds": [
        "home-schedule",
        "depot-allocation"
      ],
      "type": "site-power-allocator",
      "implementationId": "site-power-allocator",
      "url": "https://lemonergy.com/learn/glossary/blocks/site-power-allocator/",
      "documentationUrl": "https://lemonergy.com/learn/glossary/blocks/site-power-allocator/",
      "sourceFile": "block-library.json",
      "sourceRepository": "battery-design",
      "sourceRevision": "ef9802329b75bc15bb96885f8ed5d49425106696",
      "reviewed": "2026-10-27"
    }
  },
  "incoming": [
    {
      "id": "edge:usesBlock/depot-allocation/0",
      "type": "usesBlock",
      "source": "workflow:depot-allocation",
      "target": "block:site-power-allocator",
      "properties": {
        "sourceFile": "wiki-blocks.json",
        "position": 0,
        "name": "Shared site power allocator",
        "type": "site-power-allocator",
        "role": "Shares grid-side power",
        "settings": [
          "limitW",
          "ports",
          "allocation"
        ]
      }
    },
    {
      "id": "edge:usesBlock/home-schedule/1",
      "type": "usesBlock",
      "source": "workflow:home-schedule",
      "target": "block:site-power-allocator",
      "properties": {
        "sourceFile": "wiki-blocks.json",
        "position": 1,
        "name": "Shared site power allocator",
        "type": "site-power-allocator",
        "role": "Shares grid-side power",
        "settings": [
          "limitW",
          "ports",
          "allocation"
        ]
      }
    }
  ],
  "neighbors": [
    {
      "id": "workflow:depot-allocation",
      "type": "Workflow",
      "label": "Share a site supply",
      "properties": {
        "id": "depot-allocation",
        "title": "Share a site supply",
        "kind": "studio",
        "summary": "Multiple branches share one power cap.",
        "steps": [
          "Compare proportional and input-priority allocation.",
          "Lower the cap at fixed departure times."
        ],
        "example": "Three vehicles requesting 11 kW each under a 22 kW cap initially receive 7.33 kW each with proportional allocation.",
        "observe": "The site cap can hold while a vehicle misses its target.",
        "limits": "Downstream unused capacity is not silently redistributed.",
        "url": "https://design.lemonergy.com/cosim.html?example=charging-depot",
        "label": "Open the Studio example",
        "evidence": [
          "js/charging-control.js",
          "js/charging-scenarios.js",
          "docs/CHARGING_BLOCKS_SPEC.md"
        ]
      }
    },
    {
      "id": "workflow:home-schedule",
      "type": "Workflow",
      "label": "Compare charging policies",
      "properties": {
        "id": "home-schedule",
        "title": "Compare charging policies",
        "kind": "studio",
        "summary": "Compare authored schedules on the same hardware.",
        "steps": [
          "Set connection, tariff, window and target.",
          "Compare policies on this network."
        ],
        "example": "Connect a vehicle for eight hours with a cheaper window from hour 1 to hour 7.",
        "observe": "Compare cost, peak power and departure shortfall.",
        "limits": "This is deterministic policy comparison, not a forecast or economic optimum.",
        "url": "https://design.lemonergy.com/cosim.html?example=charging-home",
        "label": "Open the Studio example",
        "evidence": [
          "js/charging-control.js",
          "js/charging-scenarios.js",
          "docs/CHARGING_BLOCKS_SPEC.md"
        ]
      }
    }
  ]
}
