class FragmentComplexityDescriptor extends AbstractMolecularDescriptor implements IMolecularDescriptor {

    @Override
    public DescriptorValue calculate(IAtomContainer container) {
        //System.out.println("FragmentComplexityDescriptor");
        int a = 0;
        double h = 0;
        for (int i = 0; i < container.getAtomCount(); i++) {
            if (container.getAtom(i).getAtomicNumber() != IElement.H) {
                a++;
            }
            if (container.getAtom(i).getAtomicNumber() != IElement.H && container.getAtom(i).getAtomicNumber() != IElement.C) {
                h++;
            }
        }
        int b = container.getBondCount() + AtomContainerManipulator.getImplicitHydrogenCount(container);
        double c = Math.abs(b * b - a * a + a) + (h / 100);
        return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(c),
                getDescriptorNames());
    }

    public  FragmentComplexityDescriptor();

}