I am trying to analyze products using a product breakdown structure (PBS), which is a directed acyclic graph (DAG) that reflects a decomposition of the product into subproducts, sub-sub-products, and so on. For example, if my product is a spacecraft, I can decompose the spacecraft into a (vehicular) bus, and one or more payloads. The bus and payloads can in turn be thought of as products also, that are comprised of sub-elements. And so on. One approach for representing such a PBS can be done in Mathematica like this:
sc = <|"bus" -> "craft" , "Payload1" -> "craft", "Payload2" -> "craft", "PayComp" -> "Payload1", "Cam1" -> "PayComp", "Cam2" -> "PayComp", "power" -> "bus", "computer" -> "bus", "struct" -> "bus" , "guidance" -> "bus" , "radio" -> "bus", "solar" -> "power", "battery" -> "power"|>
And the product representation can be visually depicted with a TreePlot:
TreePlot(Normal(sc), ImageSize -> 400, DirectedEdges -> True, VertexLabeling -> True)
I would like to bind properties, simple and complex, to each node of the PBS. A simple example is mass. A more complex example might be a power consumption profile, which might itself be a tree structure (reflect the amount of electrical power required when a component is placed in one of many different states, and the state of one node defines the state of nodes below it in the hierarchy).
Is there a simple approach for adding “Mass” to each node, but more importantly to be able to add a variety of properties, since I know there are ways to represent weights for nodes and edges in graph structures. I need to have many different properties. I know there is a data set approach that even allows recursion / hierarchy, but I do not know how to recurse the query of properties throughout a hierarchy. For example, I would like to be able to arrive at a total mass of a product, which is of course the sum of the mass of its parts. A more complex calculation might be power consumption, where efficiency losses must be accounted for (in this case the power of a node is more than the sum of the power of the elements).