[Answered] Real numbers (constants) in genetic programming

Started by
3 comments, last by DarrylStein 10 years, 5 months ago

Hello,

I can't figure out how a genetically programmed A.I. can determine when there should be a constant in the final equation. If I take the formula F(m) = ma; F(m) = m9.8, how can the A.I. know what the real number 9.8 actually is? I understand that instead of putting the final number in the binary tree, you can actually put a symbol that describes a constant and then later calculate or guess what is its value in a certain way. How would you do it?

Thank you,
Thecheeselover

Hide yo cheese! Hide yo wife!

Advertisement

I don't quite understand the question or what it has to do with genetic algorithms. GAs are just a way of gradually tweaking function parameters by employing genetics and evolutional methods. The goal is to improve the overall 'fitness' of the system.

I don't quite understand the question or what it has to do with genetic algorithms. GAs are just a way of gradually tweaking function parameters by employing genetics and evolutional methods. The goal is to improve the overall 'fitness' of the system.

If I use GP to find the quadratic formula, how an individual could find the constants? (-b +- sqrt(b² - 4ac)) / (2a) In this example, the constants are 4 and 2.

Hide yo cheese! Hide yo wife!

who cares about making it complex, just kill off freaks so only the most fitting survives. just make it regenerate its sense data :)

The implementation that I used for genetic programming was representing the program as a tree. Each node in the the tree had an INode interface with a method 'Evaluate( INode[] params)'

Then I had concrete implementations of nodes for each of the different operators I wanted to represent

operator+

operator*

sqrt

while(...)

if(...)

and so on...

I also had a literal operator which just returned a bounded value which was generated randomly at instantiation of the tree (through initial creation or mutation)

so at runtime I would create a concrete class through c# IL e.g.

class literal5 : INode

{

INode Execute(INode[] params)

{

return 5.0;

}

}

hope that helps

This topic is closed to new replies.

Advertisement