assign_demands
Convert population data into per-junction base demands for an EPANET network, applying per-capita usage and peaking factor with validation and automatic unit conversion.
Instructions
Convert a population table into per-node base demands for a loaded network: demand = people × litersPerCapitaPerDay × peakingFactor ÷ 86400, converted from liters/second into the model's flow units (so GPM/CFS/MGD models get the right numbers automatically). The computed demands replace each junction's base demand through the same guarded, engine-validated path as set_junction_demand: every junction must exist, junctions with demand categories in the [DEMANDS] section are rejected (they override the [JUNCTIONS] column), each computed demand must be within the model's demand bounds, and the edited model must re-parse with exactly the requested demands and unchanged node/link counts. Previous simulation results are invalidated — re-run run_simulation afterwards. This is the 'population in, demands out' step of the GIS workflow (mcp_gis_roadmap.md Phase 3).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| networkId | Yes | The network id returned by load_network. | |
| perCapita | Yes | Per-capita consumption rate. Required — demands are never guessed from a default rate. | |
| population | Yes | Population table: one entry per junction. Each nodeId must be unique and must be an existing junction. |