Crossover July 30, 2008
Posted by tommyr in Genetic Algorithms.2 comments
I’ve been working on implementing crossover of two molecules. I’ve gotten a rudimentary crossover implementation (it uses Fragmenter2 to generate all the possible fragments of each of the parent molecules, picks two random, and joins them at two random atoms) that will probably need to be improved, but it’s good for now.
I’m getting a bunch of errors in my code when I try to run several generations at once, so the next thing for me to do is resolve these NullPointerExceptions. I think it might be caused by creating invalid molecule objects with some of the new methods in the AtomUtils class, or some of the changes I made to Mutations. I hope to have this fixed soon.
Genetic Algorithm June 29, 2008
Posted by tommyr in Genetic Algorithms.add a comment
I’ve made a lot of progress on the genetic algorithm library. I’ve gotten the Chemistry Development Kit (CDK) Java library successfully integrated with my code, which is the biggest thing. I’ve made some classes for representing a population of IAtomContainers and for performing mutations on them. I also created a nice project directory with an ant build file and everything! So it’s very easy to compile the whole project (just type ‘ant’ in the genetic_algorithm/ directory). The ant build file includes easy javadoc generation, which you can view here:
http://buzz.southwestern.edu/~rogersj/genetic_algorithm/doc/
I’ve only documented about a fourth of it, but eventually it will be more comprehensive. You can find the current code in /home/tommy/genetic_algorithm on sylow, or download it from
http://buzz.southwestern.edu/~rogersj/ga-backup.tar.gz
Fragmenter2.java June 9, 2008
Posted by genetical in Genetic Algorithms.Tags: cdk, fragmenter, molecule, split
1 comment so far
So I’ve been trying to play around with this program called “Fragmenter2.java,” which is located on sylow at /home/mattv/Summer08/utils/split, but can’t get it to run once I compile it. It requires a CDK package and in order to compile it I had to type sudo javac -cp cdk-1.-0.3.jar Fragmenter2.java. That spat out a few warnings about unchecked or unsafe operations but it compiled successfully. When trying to run it though I get an error that seems like some source file, etc. is missing. To run it, I typed sudo java -cp cdk-1.-0.3.jar Fragmenter2. Can someone take a look at it to see what is going on? I’m not the greatest when it comes to Java. This seems like a good program for splitting molecules. However, it doesn’t split rings – maybe we can modify that part of it? It doesn’t seem too hard to modify… the code is well-documented. This might help: http://cheminfo.informatics.indiana.edu/~rguha/code/java/#frags
-Chris
PS – Sylow is back up
Edge generator June 3, 2008
Posted by genetical in Genetic Algorithms.Tags: edge, generate, java, node
add a comment
We made a class, Util.java that takes two ArrayLists of objects that represent open nodes of two molecules as ArrayLists, and creates a random number of edges limited by the molecule that has less available nodes (smaller ArrayList). Each edge is generated by selecting a random node from each molecule’s ArrayList and pairing them together in another ArrayList of Object arrays. After a node is selected, it is removed from the molecule’s respective ArrayList. This process is repeated as many times as we have randomly selected the number of edges to be. We also created a driver class called Driver.java which sent test input that ran successfully.
-Chris
Genetic Algorithm in Ruby May 22, 2008
Posted by tommyr in Genetic Algorithms.Tags: genetic algorithm, ruby
1 comment so far
Sean and I wrote a simple genetic algorithm program in ruby to evolve a polynomial to fit a set of data points. Running a simple example set consisting of 3 data points, the program evolved a polynomial of degree 2 with a fitness of 0.00018 over 10,000 generations, which took about 30 seconds on my computer at home with 256 MB ram. You can find our source code on my buzz account here: