Loading src/edu/bu/ec504/project/Main.java +18 −2 Original line number Diff line number Diff line Loading @@ -15,13 +15,29 @@ public class Main { if (files != null) { for (File file : files) { if (file.isFile()) { for(int oo = 0;oo <1000;oo++) moleculeArrayList.add(new Molecule(file.getPath())); } } } } Molecule tester = new Molecule(filename); Molecule res=null; int similar=0; for(Molecule mol: moleculeArrayList) { int temp=mol.mostSimilar(moleculeArrayList.get(2)); System.out.println(mol.moleculeName+" has "+ temp + " points"); if(temp>similar) { similar=temp; res=mol; } } System.out.println("Most similar is "+ res.moleculeName); for(Molecule f: moleculeArrayList) { Molecule testing = new Molecule(filename); if (moleculeArrayList.get(0).areMoleculesEqual(testing) == null) { Loading src/edu/bu/ec504/project/Molecule.java +2 −1 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ public class Molecule implements Serializable { for (Atom newAtom : otherMolecule.atomArrayList) { if (newAtom.elementType == dbAtom.elementType) { //Check if elements are the same if (!newAtom.marked && newAtom.elementType == dbAtom.elementType) { //Check if elements are the same boolean [] edgeMarked = new boolean[newAtom.connected.size()]; // Compare connected of each atom //for each connected atom in dbAtom Loading Loading @@ -201,6 +201,7 @@ public class Molecule implements Serializable { if(matchingEdge) { newAtom.marked=true; break; } } Loading Loading
src/edu/bu/ec504/project/Main.java +18 −2 Original line number Diff line number Diff line Loading @@ -15,13 +15,29 @@ public class Main { if (files != null) { for (File file : files) { if (file.isFile()) { for(int oo = 0;oo <1000;oo++) moleculeArrayList.add(new Molecule(file.getPath())); } } } } Molecule tester = new Molecule(filename); Molecule res=null; int similar=0; for(Molecule mol: moleculeArrayList) { int temp=mol.mostSimilar(moleculeArrayList.get(2)); System.out.println(mol.moleculeName+" has "+ temp + " points"); if(temp>similar) { similar=temp; res=mol; } } System.out.println("Most similar is "+ res.moleculeName); for(Molecule f: moleculeArrayList) { Molecule testing = new Molecule(filename); if (moleculeArrayList.get(0).areMoleculesEqual(testing) == null) { Loading
src/edu/bu/ec504/project/Molecule.java +2 −1 Original line number Diff line number Diff line Loading @@ -169,7 +169,7 @@ public class Molecule implements Serializable { for (Atom newAtom : otherMolecule.atomArrayList) { if (newAtom.elementType == dbAtom.elementType) { //Check if elements are the same if (!newAtom.marked && newAtom.elementType == dbAtom.elementType) { //Check if elements are the same boolean [] edgeMarked = new boolean[newAtom.connected.size()]; // Compare connected of each atom //for each connected atom in dbAtom Loading Loading @@ -201,6 +201,7 @@ public class Molecule implements Serializable { if(matchingEdge) { newAtom.marked=true; break; } } Loading