Working with Zero-or-More Nodes
In some cases, a cost model requires an operation node to have multiple occurrences, where the number of occurrences is determined by cost model logic. There are two ways to implement this logic:
With a zero-or-more template node (see Working with Templates) and an associated zeroOrMoreOperation Module
With a zero-or-more template node and an associated occurrence generator Java plugin
The first approach is the simpler one: add a CSL module named zeroOrMoreOperation to the node. The CSL must contain a formula named numOperations which gets evaluated in order to determine the number of occurrences of the node.
Some existing cost models use a node occurrence generator instead of a zeroOrMoreOperations module. A generator is a Java plugin that provides the logic to create occurrences of zero-or-more nodes. The plugin may, in turn, call additional CSL modules to provide configurability, evaluating, for example, CSL-based operation precedence and/or compatibility rules in order to group operations under node instances. Sheet Metal – Transfer Die, for example, uses a generator to group operations by die station; the generator produces one occurrence of the parent operation Die Station for each distinct die station that the part requires. Similarly, Machining uses a generator to group operations by setup axis, and generates one occurrence of the parent operation Setup for each group.
The occurrence generator plugin is specified by the node attribute generatorName (see Working with Node Attributes). Any precedence and compatibility rules are specified in CSL modules, for example, operationPrecedence, operationTypePrecedence, and operationCompatibility modules, though the exact set of modules supported is specific to a given plugin. These modules have standard inputs for an ordered pair of operations, and contain rules that evaluate to true if, for example, the first operation in the pair must precede the second (precedence rules), or if both operations may be grouped on the same node instance (compatibility rules).
(Note that for operationCompatibility modules, you can improve performance by disabling the grouping of compatible operations under circumstances in which such grouping is not needed. To do this, add an ignoreOperationCompatibilityCSL formula to the operationCompatibility module, and have it evaluate to true when compatibility grouping is unnecessary.)
If both a zeroOrMoreOperations module and an occurrence generator are associated with a zero-or-more node, the cost engine uses the generator. If neither are present, the cost engine generates a single occurrence of the node, and issues a warning in the log:
No csl found for ZeroOrMoreNode <node-name>. Creating 1 instance of node
The following instance generators are used by current and past cost models:
com.fbc.businessmodel.costing.machining.SetupAllocator: used to allocate operations to machining setups; groups operations based on their setup axes then runs compatibility CSL to determine any further subdivision of these groupings.
com.fbc.businessmodel.costing.machining.SetupAllocator2: minor variant of SetupAllocator; allows child operations of a multi-step hole to be assigned to different setups.
com.fbc.businessmodel.costing.tree.eval.StageGenerator: generic stage generator; calls precedence CSL to group operations based on those that must be performed before others, then calls compatibility CSL to further subdivide these groups.
com.fbc.businessmodel.costing.tree.eval.StageGenerator2: minor variant of StageGenerator; evaluation of operation precedence ignores implied ordering based on operation sequences.
com.fbc.businessmodel.costing.tree.eval.StageGeneratorProcess: variant of StageGenerator2; considers the top-level processes rather than individual operations. (Not currently in use in starting point cost models.)
com.fbc.businessmodel.costing.tree.eval.DieStationGenerator: variant of StageGenerator used for Progress and Transfer Die; supports injection of idle stations via idleStationCount CSL.
com.fbc.businessmodel.costing.tree.eval.DieStationGenerator2: minor variant of DieStationGenerator; evalutation of operation precedence ignores implied ordering based on operation sequences as per StageGenerator2. (Not currently in use in starting point cost models.)
Contact aPriori Professional Services for assistance if you think you need to modify a cost model’s generator-implemented zero-or-more behavior.