if (DGelem instanceof FeatureNode) {
complexity.setF(complexity.getF() + 1);
complexity.setSubtrees(complexity.getSubtrees() + 1);
FeatureNode baseNode = (FeatureNode) DGelem;
int minCgCount = 0;
for (AbstractRelation abstractRel : baseNode
.getChildRelations()) {
if (abstractRel instanceof MandatoryRelation) {
complexity.setRand(complexity.getRand() + 1);
FDTree iEl = new FDTree();
iEl.setParent(baseNode.getName());
iEl.setElement(((MandatoryRelation) abstractRel)
.getTargetFeatureNode().getName());
tChilds.add(iEl);
}
if (abstractRel instanceof OptionalRelation) {
complexity.setRor(complexity.getRor() + 1);
FDTree iEl = new FDTree();
iEl.setParent(baseNode.getName());
iEl.setElement(((OptionalRelation) abstractRel)
.getTargetFeatureNode().getName());
tChilds.add(iEl);
if(minCgCount < 1)
complexity.setMinCg(complexity.getMinCg() + 1);
minCgCount++;
}
if (abstractRel instanceof ExclusiveCaseRelation) {
for (BaseFeatureNode baseFN : ((ExclusiveCaseRelation) abstractRel)
.getTargetFeatureNodes()) {
complexity.setRCase(complexity.getRCase() + 1);
complexity
.setSubtrees(complexity.getSubtrees() - 1);
FDTree iEl = new FDTree();
iEl.setParent(baseNode.getName());
iEl.setElement(baseFN.getName());
tChilds.add(iEl);
}
complexity.setMinCg(complexity.getMinCg() + 1);
complexity
.setSubtrees(complexity.getSubtrees() + 1);
}
if (abstractRel instanceof CaseOrRelation) {
for (BaseFeatureNode baseFN : ((CaseOrRelation) abstractRel)
.getTargetFeatureNodes()) {
complexity.setRopt(complexity.getRopt() + 1);
FDTree iEl = new FDTree();
iEl.setParent(baseNode.getName());
iEl.setElement(baseFN.getName());
tChilds.add(iEl);
}
complexity.setMinCg(complexity.getMinCg() + 1);