What is co-flow?
A second flow that travels alongside the main flow and carries an attribute, such as cost, age, or quality, so that its average can be tracked.
Co-flow diagram example
A co-flow is a parallel stock-and-flow structure that follows an attribute of the items in another stock. The attribute can be money, age, skill, or defects. It matters because it lets a model keep track of the average value of that attribute without following each item separately.
How it works
A main stock tracks how many items there are. A second stock tracks the total amount of the attribute across those items. Whenever items enter, the attribute enters with them, equal to the number times their attribute level. Whenever items leave, they take with them the average attribute, which is the attribute total divided by the number of items. The average at any time is the attribute total divided by the count, an auxiliary variable.
Without a co-flow, a model has to assume that all items share one average value, which can be badly wrong when old and new items differ. Co-flows are common in aging chains, where average age or tenure matters, and in inventory models, where cost per unit changes. They keep the benefits of aggregate stock and flow models, speed and clarity, while removing a strong simplification.
Example
Say a team has 20 people with a total yearly payroll of 2,000,000, so the average cost is 100,000. The company hires 10 people at 150,000 each. Headcount becomes 30 and payroll becomes 3,500,000, so the average is about 116,700. Then 5 people leave, taking the average of 116,700 each, or 583,500 in total. Headcount becomes 25 and payroll about 2,916,500. This is an illustration with round numbers.
How to model it in Machinations
Use one Pool for headcount and another Pool for payroll. A Source feeds headcount, and a second Source feeds payroll at the hire count times the hire salary through a state connection. A Drain on each Pool removes people and payroll together, with the payroll drain set by a Register for the average. Chart the average Register, and move the hire-salary Lever.
See co-flow in a system you can Play
Build the rules in a Machinations diagram, change a value and Play it to watch how the system responds.