Ejemplo n.º 1
0
        public void GetBest(out int[] values, out int fitness)
        {
            Genome g = ((Genome)m_thisGeneration[m_populationSize - 1]);

            values = new int[g.Length];
            g.GetValues(ref values);
            fitness = (int)g.Fitness;
        }
Ejemplo n.º 2
0
        public void GetBest(out double[] values, out double fitness)
        {
            Genome g = m_thisGeneration[m_populationSize - 1];

            values = new double[g.Length];
            g.GetValues(ref values);
            fitness = g.Fitness;
        }
Ejemplo n.º 3
0
        public void GetNthGenome(int n, out int[] values, out int fitness)
        {
            if (n < 0 || n > m_populationSize - 1)
            {
                throw new ArgumentOutOfRangeException("n too large, or too small");
            }
            Genome g = ((Genome)m_thisGeneration[n]);

            values = new int[g.Length];
            g.GetValues(ref values);
            fitness = (int)g.Fitness;
        }
Ejemplo n.º 4
0
        public void GetNthGenome(int n, out double[] values, out double fitness)
        {
            /// Preconditions
            /// -------------
            if (n < 0 || n > m_populationSize - 1)
            {
                throw new ArgumentOutOfRangeException("n too large, or too small");
            }
            /// -------------
            Genome g = m_thisGeneration[n];

            values = new double[g.Length];
            g.GetValues(ref values);
            fitness = g.Fitness;
        }