Exemplo n.º 1
0
        private List<double[]> getRandomSubset(Species species)
        {
            List<double[]> matrix = new List<double[]>();

            int startIndex = rand.Next(species.data.Count);
            int endIndex = rand.Next(species.data.Count);
            if (startIndex > endIndex)
                startIndex = endIndex;
            if (startIndex != endIndex)
            {
                for (int i = 0; i < endIndex - startIndex; i++)
                {
                    matrix.Add(species.data[i]);
                }
            }
            else
                matrix.Add(species.data[startIndex]);
            return matrix;
        }
Exemplo n.º 2
0
 private double[] getRandomIndividualFromSpecies(Species species)
 {
     int randIndex = rand.Next(species.data.Count);
     return species.data[randIndex];
 }