Пример #1
0
        public Population(UserInput userInput)
        {
            var upperBound = (int)Math.Pow(2, userInput.D);
            var grayHelper = new GrayHelper(upperBound);

            Individuals = new Queue <Individual>(userInput.PopulationSize);

            for (int i = 0; i < userInput.PopulationSize; i++)
            {
                Individuals.Enqueue(new Individual(grayHelper, userInput));
            }

            SetInitialPositions(upperBound, userInput.Dimensions);
        }
Пример #2
0
 public Individual(GrayHelper grayHelper, UserInput userInput)
 {
     this.grayHelper = grayHelper;
     this.userInput  = userInput;
     bTranspose      = np.transpose(new[] { userInput.B });
 }