AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

beginner question

The forum is to discuss topics from different artificial intelligence areas, like neural networks, genetic algorithms, machine learning, etc.

beginner question

Postby gl2000 » Tue Aug 06, 2013 1:28 am

The library is impressive. I'm new to GA and have done some reading, but have what should be a simple question.

In your OptimizationFunction2d, you optimize 2 inputs, both having some range. This is represented in one single binary chromosome correct? It's basically 1 byte, which represents 2 numbers? How do you know which part of it represents which input? How is -1, 2 represented for example?
And if I wanted to to a 10D optimization, I would need to create a fitness function, and a crossover/mutation?

thank you.
gl2000
 
Posts: 1
Joined: Tue Aug 06, 2013 1:23 am

Re: beginner question

Postby andrew.kirillov » Wed Aug 07, 2013 10:12 am

gl2000 wrote: It's basically 1 byte, which represents 2 numbers?

No. When you create binary chromosome you can specify its length in bits. Up to 64 bits length can be specified, which is 8 bytes.

gl2000 wrote: How do you know which part of it represents which input?

If you have 64 bits for 2 variables, for example, then just use lower 32 bits for the first and other 32 bits for the second variable. Check source code.

gl2000 wrote:And if I wanted to to a 10D optimization, I would need to create a fitness function, and a crossover/mutation?

For 10 variables you can try DoubleArrayChromosome - it already has mutation and crossover implemented. But you will need fitness function to do. If this chromosome does not suite your needs, then you can implement a new one with mutation/crossover for it.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3447
Joined: Fri Jan 23, 2009 9:12 am
Location: UK




Return to Artificial Intelligence

cron