Map Production State
Map raw rows into the scenario's production state table: the outcome of production. It records how many units of each recipe were produced at each site, and the conversion cost realized.
This is the observed side of production. Pair it with Map Production Policy for the rule.
When to use this¶
- You have a baseline of what was produced and want Cost to Serve to roll production cost into finished goods
- You're importing observed manufacturing volumes rather than optimizing them
Network Optimization writes this table itself from its production decision. Map it only when you have an observed baseline to load.
What you need¶
- A Map Bill of Materials node defining each recipe
- An upstream Import Data node with one row per (location, recipe) that was produced
- A produced-quantity column, and optionally the realized conversion cost
Field mapping¶
Fields are matched by name unless you set them. When the workflow runs, every field you have not set a column for is matched against the headers listed below, case-insensitively and ignoring spaces around the header, and a space inside your header reads as an underscore, so Site Name matches site_name. Setting a column for one field fixes that field only; the others keep following your file's headers, so a renamed column is still found. A required field that no column supplies — no header matched, or you set none or one your table lacks — is reported once, with the headers your table does have.
Set mappings in the node's panel. Connect an upstream table and select the mapping node. A field matched by name is marked Matched by name; pick a column to set it yourself, and Match by name puts it back. Match all by name clears every field you set. Required fields without a match are marked in the panel.
Reshape rows in a Script first. A mapping node only says which column is which field. To drop rows, recode values, or split or combine columns, connect a Script node before it and map the columns the Script returns.
Same for every row. A file with no unit column still states its unit: in Quantity Unit, pick Same for every row and type the unit, such as bike, and every row is in it. Over MCP, set it in field_mappings as "quantity_unit": "__const__:bike". Quantity Unit is required on every row with Produced Quantity, and the panel marks it required once it is mapped.
| Field | Type | Required | Example | What it is | Auto-detected headers |
|---|---|---|---|---|---|
| Location | text | Yes | Berlin Assembly Plant |
Where production occurred. Must match a Location name. | location, loc, name, id, location_id, loc_id |
| Bom Name | text | Yes | City Bike BoM |
Recipe that was produced. Must match a recipe on the bill of materials table. | bom_name |
| Produced Quantity | number | No | 300.0 |
Units of the output product actually produced in the recorded baseline. Must be greater than or equal to 0. Its unit goes in Quantity Unit. | produced_quantity |
| Quantity Unit | text | No | bike |
Unit the produced quantity is in, as a unit of the output product. Required on every row that carries one. A unit other than the scenario's needs a conversion for the product. | quantity_unit, qty_unit, unit, uom |
| Realized Cost | number | No | 12000.0 |
Total production conversion cost actually incurred in the baseline (not per-unit; excludes component cost). Zero, or absent, in a network that only distributes what it buys in. Negative amounts record credits against this cost. | realized_cost, supply_cost, handling_cost, total_supply_cost, production_cost, total_handling_cost |
| Realized Emissions | number | No | 900.0 |
Total emissions actually produced by manufacturing in the baseline, in the scenario's emissions unit, set on Create Scenario. Must be greater than or equal to 0. | realized_emissions, emissions, co2, carbon, ghg, carbon_emissions |
How it works¶
Each row records production at a site. Cost to Serve reads the produced quantity to size component consumption, then rolls the components' cost plus the realized conversion cost up into the finished good's cost to serve.
Workflow wiring¶
flowchart LR
n1["Import Data (bom.csv)"] --> n2["Map Bill of Materials"]
n3["Import Data (production.csv)"] --> n4["Map Production State"]
n5["Import Data (locations.csv)"] --> n6["Map Locations"]
n7["Import Data (products.csv)"] --> n8["Map Products"]
n2 & n4 & n6 & n8 --> n9["Create Scenario"]
Common mistakes¶
- Putting the per-unit rate here. Realized Cost is the total incurred. The per-unit conversion rate belongs on Map Production Policy.
- No matching recipe. The Bom Name must match a recipe on the bill of materials table.
Messages this node can show¶
- Field matches several columns
- Mapped table empty
- Number outside its allowed bound
- Required field absent
- Row doesn’t fit its table
- Text padded with spaces
- Value not a plain number
The table this node makes is checked again with the rest of the scenario when Create Scenario assembles it: see messages about the scenario.
A run gives this node 5 minutes. A node that takes longer stops with Time limit reached.
Like every node, it can also stop on the checks before a run and the run's limits.