• Advertisement
Sign in to follow this  

[Answered] Real numbers (constants) in genetic programming

This topic is 1581 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement