Accord.Genetic.BinaryChromosome.ToString C# (CSharp) Method

ToString() public method

Get string representation of the chromosome.
public ToString ( ) : string
return string
        public override string ToString()
        {
            ulong tval = val;
            char[] chars = new char[length];

            for (int i = length - 1; i >= 0; i--)
            {
                chars[i] = (char)((tval & 1) + '0');
                tval >>= 1;
            }

            // return the result string
            return new string(chars);
        }