From: Christoph S. <ste...@us...> - 2001-10-15 16:37:01
|
Update of /cvsroot/cdk/cdk/org/openscience/cdk/structgen In directory usw-pr-cvs1:/tmp/cvs-serv8957/org/openscience/cdk/structgen Modified Files: RandomGenerator.java Log Message: Changes to the RandomStructureGenerator Index: RandomGenerator.java =================================================================== RCS file: /cvsroot/cdk/cdk/org/openscience/cdk/structgen/RandomGenerator.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** RandomGenerator.java 2001/10/10 13:01:00 1.9 --- RandomGenerator.java 2001/10/15 16:36:58 1.10 *************** *** 83,108 **** public Molecule proposeStructure() { do { ! trial.removeAllBonds(); ! trial.addBonds(molecule); mutate(trial); ! if (true) { ! String s = "BondCounts: "; ! for (int f = 0; f < trial.getAtomCount(); f++) ! { ! s += trial.getBondCount(trial.getAtomAt(f)) + " "; ! } ! System.out.println(s); ! s = "BondOrderSums: "; ! for (int f = 0; f < trial.getAtomCount(); f++) ! { ! s += trial.getBondOrderSum(trial.getAtomAt(f)) + " "; ! } ! System.out.println(s); } - - } while(!cc.isConnected(trial)); --- 83,108 ---- public Molecule proposeStructure() { + if(debug) System.out.println("RandomGenerator->proposeStructure() Start"); do { ! //System.out.println("molecule: " + molecule); ! trial = (Molecule)molecule.clone(); ! //System.out.println("trial: " + trial); mutate(trial); ! if(debug) { ! String s = "BondCounts: "; ! for (int f = 0; f < trial.getAtomCount(); f++) ! { ! s += trial.getBondCount(trial.getAtomAt(f)) + " "; ! } ! System.out.println(s); ! s = "BondOrderSums: "; ! for (int f = 0; f < trial.getAtomCount(); f++) ! { ! s += trial.getBondOrderSum(trial.getAtomAt(f)) + " "; ! } ! System.out.println(s); } } while(!cc.isConnected(trial)); *************** *** 135,138 **** --- 135,139 ---- protected void mutate(AtomContainer ac) { + if(debug) System.out.println("RandomGenerator->mutate() Start"); int nrOfAtoms = ac.getAtomCount(); int x1 = 0, x2 = 0, y1 = 0, y2 = 0; *************** *** 159,162 **** --- 160,164 ---- y1 = (int)(Math.random() * nrOfAtoms); y2 = (int)(Math.random() * nrOfAtoms); + if (debug) System.out.println("RandomGenerator->mutate(): x1, x2, y1, y2: " + x1 + ", " + x2 + ", " + y1 + ", " + y2); } while (!(x1 != x2 && x1 != y1 && x1 != y2 && x2 != y1 && x2 != y2 && y1 != y2)); *************** *** 210,213 **** --- 212,216 ---- a22 = 0; } + if(debug) System.out.println("RandomGenerator->mutate()->The old bond orders: a11, a12, a21, a22: " + + a11 + ", " + a12 + ", " + a21 + ", " + a22); }while(nonZeroBondsCounter < 2); |