I'm trying to make some kind of AI that will have acess to his own code and can modify it during the execution to be able to evolve
for example, during the runtime I want it to be able to change it's code from :
if (a>1){doSomething();}
to :
if (a>1){doSomethingElse();}
It is possible to do such a thing ?
If it is not possible, is it possible instead of writting it in a function, to have a String containing the algorithm like this :
String code = "if (a>1){doSomethingElse();}";
and running the string as code like that :
run(code);
And again, if that's not possible in java, is there a programming language where it can be possible ?