Sorry if I was not clear. It's perfectly clear in my head, why can't you see it!
My BOMs looks like this.
LEVEL,PartNumber,ECO#,Revision#
Or looking at it in indent format
1,PN1234,ECO9800,REV1
2,PN12367,ECO9480,REV6
2,PN54325,ECO9379,Rev0
3,PN7888,ECO8790,Rev9
....
2,PN8903,ECO909,Rev0
1,PN5464,ECO9803,REV3
....
So for example PN7888 is part of the assembly PN54325 which is one of three
part/assemblies in PN1234. PN7888 has no relationship to PN12367 except that
if you go far enough up the assemblies you have a common parent.
Here are the problems.
- Compare revisions and ECOs for parts between BOMs. I can conceptually see how to do that.
This is the one I can't get a good grasp on how to best program.
- Keep track of the parts that make up an assembly and identify additions,
subtractions and replacements.
The problem here is how do I do this efficiently. For example: if I am moving
down the assembly and I reach PN1234, I would want to check all the 2 level
parts under the assembly, on one pass, then go back and check all the level 3
parts under PN54325. And so on. This goes on and could reach 15-20K parts in
15 levels.
What should I do load two sets of 20,000 entries into two hashes?
I have read that it is more efficient to use a while loop and read the lines,
one at a time. But once I have read all Level 2 in one assembly how do I go
back for additional passes to pull the deeper assemblies.
Edit kudra,
2002-06-08
Removed pre tags, added other markup
| [reply] |
BoM always seem difficult!
A brute force approach is to stringify each part at each level and diff corresponding parts. As usual with brute force methods this could take more memory than you have.
You seem to talking about a flat structure. My second thought is to build the nested structure for both your BoM then walk the trees. I see it as a hash with part# as key and an array of (references to) sub-parts as the value. So, for each part#, check whether it exists, if not add it (initially with an empty value). Add (a ref to) the new part to the parent.
Does this make sense?
| [reply] |
<html>
<head>
<meta name="Generator" content="Vim/6.0">
</head>
<body bgcolor="#000000" text="#ffffff">
I think that the difficulty I was having is that a PN may
occur in several places, however all sub-part numbers should
be the same. So I think that applying your sugestion but with
the limitation of only associating the direct child part to
any partnumber. I should be able to cycle through the BOM without
generateing a hash with 20K parts.
Thank you, I know this was not the best thread of comunication.
</body>
</html> | [reply] |