A slightly alternate approach would be to define a function accepting as input a goods type, and returning a road way type. The function (or, more likely, a helper function) would choose the lightest road vehicle (or combination of motive power + carriage) at the present time for that good, and select the cheapest road way which can accommodate (using the constraints) that hypothetical convoy. The factory builder would select road waytype via that function. This would need no pakset changes and no new data structures.