suicao / aforge

Automatically exported from code.google.com/p/aforge
Other
0 stars 0 forks source link

Code style of Genetic #298

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Good day.

I am learning Genatic Algorithms and use you framework for that.
I am proud to see code with such good quality. You are great ;)

I have several questions:
1. Why do you put Evaluation to Chromosome itself? (
code:
public void Evaluate( IFitnessFunction function )
        {
            fitness = function.Evaluate( this );
        }
)
Is it done to protect fitness of Chromosome from external changes?

2. Some properties looks like:
 protected int length;
 public int Length
        {
            get { return length; }
        }

Why don't you use property like:

public int Length
        {
            get; protected set;
        }
Does it have sacral sence or it's legasy?

3. According to C# naming conventions non private instance variables should 
atart from Capital letter.

Example:
protected ulong val = 0;

May be it should be renamed to satisfy convention?

4. // Copyright © AForge.NET, 2006-2011
But today is 2012 ;)))

I can do refactoring in Genetic and make a patch, if it has any sence for you. 
Would you like to have it?

PS you code is wonderfull and i do not waте to say that anything wrong. I can 
just improve it for you =)

I'm looking forward to see your answer ;)

Original issue reported on code.google.com by Ru.Lazu...@gmail.com on 14 May 2012 at 10:44

GoogleCodeExporter commented 9 years ago

Original comment by andrew.k...@gmail.com on 2 Jun 2012 at 2:54