apricoti

 

DependencyCounting

Page history last edited by Jonathan Buhacoff 4 yrs ago

I'm interested in generating lists of dependencies for hardware and software components in my project. I want it to answer questions like, "if I want three more foo, how many bars do I need? do I need any baz with that?"

 

This is different than the regular variety of dependency tracking because here, the numbers matter. I already know all the dependencies in a true/false sense. I have a list of the parts. The answers I want are numbers. Using a counting dependency tracker, I could also generate the part names list by counting all parts having a count greater than zero, and that would be a special application of this more general tool that I need.

 

Usage

 

I haven't found such a tool yet, and I haven't written one. But if I had one, it would be nice if I could pass in data like this:

 

foo = bar:4, baz:f(1), quux:1
quux = bar:1, york:2

 

And then ask questions like:

 

  • If I build 3 foo, how many bars do I need? 3*4 bars in foo + 3*1*1 bars in quux in foo = 15 bars in 3 foo
  • If I build 3 foo, how many baz do I need? 3*f(1) baz in foo = 1 ... magically... assuming f(1) was such a function that overrides the answer so that no matter how many foo I build, I only need 1 baz for all of them.

 

If an item isn't defined with its own dependencies, it is assumed to be a simple component.

 

The f(1) thing implies that the data should be extensible with functions that provide special dependency behavior. Certain functions, like the one in my example, could be included in the tool to make life easy, but users should be able to write their own and invoke it.

 

Recursive behavior should be determined by the user. For example, if a york is defined like this:

 

york = quux:1

 

Then some possibilities are:

 

  • How many quux to build 1 foo? 1*1 quux in foo = 1 quux in 1 foo (depth limit 1 or 2)
  • How many quux to build 1 foo? 1*1 quux in foo + 1*1*2*1 quux in york in quux in foo = 3 quux in 1 foo (depth limit 3)
  • How many quux to build 1 foo? Not possible to build recursive product (no depth limit and recursion not allowed)
  • How many quux to build 1 foo? 1*1 quux in foo + 1*1*2*0 quux in york in quux in foo = 1 quux in 1 foo (no depth limit and ignoring recursion)

Comments (0)

You don't have permission to comment on this page.