Designed For Software (Instead Of Humans) To Usefractal simplicity |
![]() |
          |
CodeSimian's goals are CS objects, anonymous functions that can specify anything. Goals are optional and redefinable. Those functions take one PARAM: the CS object to measure and return a score for. Goals are like a fitness function in a genetic-algorithm, but they can be used with ANY of CodeSimian's objects including artificial-intelligence objects. Goals are part of the root class: CS. CS.pType(int) returns the goal object for a specific PARAM index. CS.setPType(int,CS) sets a goal. This will be used to put high-scoring objects into the PARAM positions they scored high in and keep them away from PARAM positions they score low in. Since goals are simply CS objects, they can also evolve in a turing-complete environment. Theoretically not just the groups of code evolve. The rules of evolution will also evolve. But it can only evolve what you program it to evolve, right? Currently true, but theoretically false. Code can evolve to do anything that any CS object can do. Some CS objects are designed to connect to the object-oriented parts of Java code, and can sometimes be used to control other Java programs, which is more than enough space in the evolution environment. Example, this CodeSimian code turns the Java-Virtual-Machine off, with exit code 5: method#java.lang.System.exit(a b 5) "java.lang.System.exit" is the name of the CS object, and in the case of method CSs, its also the name of the Java Method/function it wraps. That CS stores the parameter Java objects and primitives wrapped in CS objects. "a" is replaced by the return-value of System.exit(int) when that function is executed. "b" is normally used for the instance object the function is called from, but in this case its static so "b" is not used. "5" is the 1 int parameter, but it could be used as any Object, array, or primitive type, assuming no ClassCastException occurs. Interpret "5" as an array and you get an array size 0 since it contains no other CSs. Interpret as Object and it depends if it understands how to convert itself to the specific Object type. This example code uses "5" as a java.awt.Component: window(5) pops up a JFrame window containing a JTree containing 1 node displayed as "5". This can be done for any public function in any Java object or class. It would be bad if evolved code was allowed to turn the whole program off, but I dont think its necessary to restrict which Java functions and variables it can use. Threads and try/catch/Exceptions can be used to prevent or fix most errors. If one Thread turns itself off, the other Threads would continue evolving. If some evolved code cant figure out why it keeps getting IOExceptions, let it be confused, delete it, and evolve better code to use IO. The IOExceptions wont crash the program. They'll just make parts of it not work, and those parts will be replaced. Software that creates and modifies software. |
        
![]()
|