for an evolving AI ( my dna project dna project I wan't to randomize java code completely but I don't know if this is possible.
whit randomise I don't mean via
but extulla randomise the code it runs it self example :
this :
becomes this :
or something like that
I had a few ideas on how to do this:
1. keep a sourceversion and complie
to randomise the code I would copy the source version of the code, read it in, change some stuff what I read, write it back, try to compile it
if this fails : delete the copy of the source version and start over.
if this works overwirte the jar file of the program
plausible problems : -- maby I can't accces the jar file while it's executing
-- how do I complie the code ?
2. make a kind of program language
set the code up to look in a seperate file with code in and then execute methods based on that code.
if you try to copy : copy the file randomise it , check if it's still valid
if it is : overwrite the real file with the modified file
if it isn't try again
with is the easies and with one will work is there an even easier way to do this ?
Greenfoot.getRandomNumber(options);
if(Greenfoot.getRandomNumber(100) < 20) {
//do stuff
}if(Greenfoot.getRandomNumber(99) < 22) {
//do stuff
}

