private double getTopologicalFactors ( IAtomContainer atomContainer , IAtomContainer ac ) { /* factor for separation of charge */ int totalNCharge1 = AtomContainerManipulator . getTotalNegativeFormalCharge ( atomContainer ) ; int totalPCharge1 = AtomContainerManipulator . getTotalPositiveFormalCharge ( atomContainer ) ; double fQ = 1.0 ; if ( totalNCharge1 != 0.0 ) { fQ = 0.5 ; for ( int i = 0 ; i < atomContainer . getBondCount ( ) ; i ++ ) { IBond bond = atomContainer . getBond ( i ) ; if ( bond . getBegin ( ) . getFormalCharge ( ) != 0.0 && bond . getEnd ( ) . getFormalCharge ( ) != 0.0 ) { fQ = 0.25 ; break ; } } } /* factor, if the number of covalents bonds is decreased */ double fB = 1.0 ; int numBond1 = 0 ; int numBond2 = 0 ; for ( int i = 0 ; i < atomContainer . getBondCount ( ) ; i ++ ) { if ( atomContainer . getBond ( i ) . getOrder ( ) == IBond . Order . DOUBLE ) numBond1 += 1 ; if ( ac . getBond ( i ) . getOrder ( ) == IBond . Order . DOUBLE ) numBond2 += 1 ; } if ( numBond1 < /* > */ numBond2 ) fB = 0.8 ; double fPlus = 1.0 ; if ( totalNCharge1 == 0.0 && totalPCharge1 == 0.0 ) fPlus = 0.1 ; /* aromatic */ double fA = 1.0 ; try { if ( Aromaticity . cdkLegacy ( ) . apply ( ac ) ) if ( ! Aromaticity . cdkLegacy ( ) . apply ( atomContainer ) ) fA = 0.3 ; } catch ( CDKException e ) { e . printStackTrace ( ) ; } logger . debug ( "return " + fQ * fB * fPlus * fA + "= sp:" + fQ + ", dc:" + fB + ", fPlus:" + fPlus + ", fA:" + fA ) ; return fQ * fB * fPlus * fA ; }
get the topological weight factor for each atomContainer .