class FMFDescriptor extends AbstractMolecularDescriptor implements IMolecularDescriptor {

    @Override
    public DescriptorValue calculate(IAtomContainer container) {

        container = clone(container); // don't mod original

        MurckoFragmenter fragmenter = new MurckoFragmenter(true, 3);
        DoubleResult result;
        try {
            fragmenter.generateFragments(container);
            IAtomContainer[] framework = fragmenter.getFrameworksAsContainers();
            IAtomContainer[] ringSystems = fragmenter.getRingSystemsAsContainers();
            if (framework.length == 1) {
                result = new DoubleResult(framework[0].getAtomCount() / (double) container.getAtomCount());
            } else if (framework.length == 0 && ringSystems.length == 1) {
                result = new DoubleResult(ringSystems[0].getAtomCount() / (double) container.getAtomCount());
            } else
                result = new DoubleResult(0.0);
        } catch (CDKException e) {
            result = new DoubleResult(Double.NaN);
        }
        return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), result,
                getDescriptorNames());

    }

    public  FMFDescriptor();

}