I'm trying to run a simple genetic algorithm example from here and I compiled the given code example at the bottom of the page. I've compiled the code two ways, made a Java Application but with classes only and ran it in netbeans and I can run GA.class on netbeans fine. Then I retyped it in gedit and saved all the files. First it was a problem trying to compile the files as all of them had dependencies to each other but I solved that with setting the classpath from a few posts here.
My current problem is that it gives me the Could not find or load main class GA
error. I've copied the code word by word. And from a few of the posts, most mention about setting the classpath and I already did that with this:
export CLASSPATH=/home/Desktop/Genetic\ Algorithm
which is where I put Population, Inididual, Algorithm, FitnessCalc, and GA.
and I tried to run it with multiple lines, here are a few:
java simpleGa.GA
java -cp /home/Desktop/Genetic\ Algorithm/simpleGa GA
and some iterations where I simply changed GA to simpleGa.GA etc. Did I set the classpath incorrectly, or is there something wrong with the code that makes it not possible this way, or might I need some other tool for this, which I don't think anything else is needed(?)
PS: not sure if this question fits here but I just started learning genetic algorithm, do you have any references you would recommend to read in order to understand better or delve deeper into how it works etc