AI Group:
RubyGP is a simple concept interpreter for building Genetic Programs.
Arguments in an Interpreter#sequence can be sampled from a weighted function list, cloned, or multi-inherited. Processed into a MultiStack. The end of one of the MultiStack stacks (such as the Integer stack) is then used to build some object, which is compared to a fitness object. (not yet implemented)
These arguments can be of -any- type. Implement your own custom procs for a Proc stack, for example. A sequence can be bred:
...demonstrate...
The methods that you ‘expose’ on MultiStack::Operations are accessible and destructive on the stack:
class MultiStack module Operations module_function
def multiply(a,b); a * b end end end
class Parabola < Interpreter def self.function_list; %w(add add multiply ERF ERF X) end def solve self.stack.last end end
The strings “ERF” and “X” are magic strings. See the code.
[email protected] with GP expertise by Bradford Barr