/** * Calculates a score based on the intersection of bonds. * *@param ac The Atomcontainer to work on *@param overlappingBonds Description of the Parameter *@return The overlapScore value */ public double getBondOverlapScore(IAtomContainer ac, Vector overlappingBonds) { overlappingBonds.removeAllElements(); double overlapScore = 0; IBond bond1 = null; IBond bond2 = null; double bondLength = GeometryUtil.getBondLengthAverage(ac);; double overlapCutoff = bondLength / 2; for (int f = 0; f < ac.getBondCount(); f++) { bond1 = ac.getBond(f); for (int g = f; g < ac.getBondCount(); g++) { bond2 = ac.getBond(g); /* bonds must not be connected */ if (!bond1.isConnectedTo(bond2)) { if (areIntersected(bond1, bond2)) { overlapScore += overlapCutoff; overlappingBonds.addElement(new OverlapPair(bond1, bond2)); } } } } return overlapScore; }
/** * Calculates a score based on the intersection of bonds. * *@param ac The Atomcontainer to work on *@param overlappingBonds Description of the Parameter *@return The overlapScore value */ public double getBondOverlapScore(IAtomContainer ac, Vector overlappingBonds) { overlappingBonds.removeAllElements(); double overlapScore = 0; IBond bond1 = null; IBond bond2 = null; double bondLength = GeometryUtil.getBondLengthAverage(ac);; double overlapCutoff = bondLength / 2; for (int f = 0; f < ac.getBondCount(); f++) { bond1 = ac.getBond(f); for (int g = f; g < ac.getBondCount(); g++) { bond2 = ac.getBond(g); /* bonds must not be connected */ if (!bond1.isConnectedTo(bond2)) { if (areIntersected(bond1, bond2)) { overlapScore += overlapCutoff; overlappingBonds.addElement(new OverlapPair(bond1, bond2)); } } } } return overlapScore; }