Ejemplo n.º 1
0
        public IOptimizationResults <T> Evolve( )
        {
            if (this.AlgebraProvider == null)
            {
                throw new ArgumentNullException("The Rosenbrock optimizer must have its AlgebraProvider property not set to 'null'");
            }
            currentPoint = startingPoint;
            IBase   b           = createNewBase(currentPoint);
            IVector stepsLength = b.CreateVector( );

            for (int i = 0; i < stepsLength.Length; i++)
            {
                stepsLength[i] = initialStep;
            }
            List <IObjectiveScores <T> > scores = new List <IObjectiveScores <T> >();

            while (!terminationCondition.IsFinished() && !isCancelled)
            {
                var endOfStage = performStage(b, currentPoint, stepsLength);
                b            = endOfStage.Item1;
                currentPoint = endOfStage.Item2;
                scores.AddRange(endOfStage.Item3);
            }
            //return new BasicOptimizationResults<T>( new IObjectiveScores<T>[] { currentPoint } );
            return(new BasicOptimizationResults <T>(scores.ToArray()));
        }