use of edu.umn.cs.crisys.safety.analysis.ast.visitors.AddFaultsToNodeVisitor.FaultSetProbability in project AMASE by loonwerks.
the class FTResolveVisitor method isSubset.
private boolean isSubset(FTNonLeafNode node, ArrayList<FaultSetProbability> faultCombinationsAboveThreshold) {
boolean isSubset = false;
HashSet<String> childNodeSet = new HashSet<String>();
for (FTNode childNode : node.childNodes.values()) {
if (!(childNode instanceof FTLeafNode)) {
throw new SafetyException("Trying to prune node " + node.nodeName + " with non leaf child " + childNode.nodeName);
} else {
childNodeSet.add(((FTLeafNode) childNode).lustreFaultName);
}
}
for (FaultSetProbability faultCombination : AddFaultsToNodeVisitor.faultCombinationsAboveThreshold) {
HashSet<String> faultCombinationSet = faultCombination.toStringSet();
if (faultCombinationSet.containsAll(childNodeSet)) {
isSubset = true;
return isSubset;
}
}
return isSubset;
}
Aggregations