class PetitjeanNumberDescriptor extends AbstractMolecularDescriptor implements IMolecularDescriptor {

    @Override
    public DescriptorValue calculate(IAtomContainer atomContainer) {
        IAtomContainer cloneContainer = AtomContainerManipulator.removeHydrogens(atomContainer);
        double petitjeanNumber; //weinerPath
        int diameter = PathTools.getMolecularGraphDiameter(cloneContainer);
        int radius = PathTools.getMolecularGraphRadius(cloneContainer);

        if (diameter == 0)
            petitjeanNumber = 0;
        else
            petitjeanNumber = (diameter - radius) / (double) diameter;
        return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(
                petitjeanNumber), getDescriptorNames());
    }

    public  PetitjeanNumberDescriptor();

}