Inheritance: BasicGene
        /// <summary>
        /// Construct a neural genome.
        /// </summary>
        ///
        /// <param name="network">The network to use.</param>
        public NeuralGenome(BasicNetwork network)
        {
            Organism = network;

            _networkChromosome = new Chromosome();

            // create an array of "double genes"
            int size = network.Structure.CalculateSize();
            for (int i = 0; i < size; i++)
            {
                IGene gene = new DoubleGene();
                _networkChromosome.Genes.Add(gene);
            }

            Chromosomes.Add(_networkChromosome);

            Encode();
        }
Example #2
0
 public NeuralGenome(BasicNetwork network)
 {
     int num;
     int num2;
     goto Label_0058;
     Label_0008:
     if (num2 >= num)
     {
         if ((((uint) num2) & 0) == 0)
         {
             base.Chromosomes.Add(this._x8b1a2d051765aa13);
             this.Encode();
             return;
         }
         goto Label_0058;
     }
     IGene item = new DoubleGene();
     this._x8b1a2d051765aa13.Genes.Add(item);
     Label_0052:
     num2++;
     if ((((uint) num) + ((uint) num)) <= uint.MaxValue)
     {
         goto Label_0008;
     }
     return;
     Label_0058:
     base.Organism = network;
     this._x8b1a2d051765aa13 = new Chromosome();
     num = network.Structure.CalculateSize();
     num2 = 0;
     if (0 != 0)
     {
         goto Label_0052;
     }
     goto Label_0008;
 }