/** * Constructor for the StabilizationPlusChargeDescriptor object */ public StabilizationPlusChargeDescriptor() { stabil = new StabilizationCharges(); }
GasteigerPEPEPartialCharges pepe = new GasteigerPEPEPartialCharges(); Polarizability pol = new Polarizability(); StabilizationCharges stabil = new StabilizationCharges(); StructureResonanceGenerator gRI = new StructureResonanceGenerator(); results[5] += stabil.calculatePositive(product, product.getAtom(position)); else results[5] += 0.0;
/** * The method calculates the stabilization of charge of a given atom * It is needed to call the addExplicitHydrogensToSatisfyValency method from the class tools.HydrogenAdder. * *@param atom The IAtom for which the DescriptorValue is requested *@param container AtomContainer *@return return the stabilization value */ @Override public DescriptorValue calculate(IAtom atom, IAtomContainer container) { IAtomContainer clone; IAtom localAtom; try { clone = (IAtomContainer) container.clone(); localAtom = clone.getAtom(container.indexOf(atom)); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(clone); } catch (CDKException e) { return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult( Double.NaN), NAMES, e); } catch (CloneNotSupportedException e) { return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult( Double.NaN), NAMES, e); } double result = stabil.calculatePositive(clone, localAtom); return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(result), NAMES); }
GasteigerPEPEPartialCharges pepe = new GasteigerPEPEPartialCharges(); Polarizability pol = new Polarizability(); StabilizationCharges stabil = new StabilizationCharges(); StructureResonanceGenerator gRI = new StructureResonanceGenerator(); results[5] = stabil.calculatePositive(product, product.getAtom(position)); else results[5] = 0.0;
public void testCalculatePositive_IAtomContainer_IAtom() throws Exception { StabilizationCharges sc = new StabilizationCharges(); Assert.assertNotSame(0.0, sc.calculatePositive(molecule, molecule.getAtom(i))); else Assert.assertEquals(0.0, sc.calculatePositive(molecule, molecule.getAtom(i)), 0.001);
/** * A unit test suite for JUnit. * * @return The test suite */ @Test public void testStabilizationCharges() { Assert.assertNotNull(new StabilizationCharges()); }