예제 #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()));
        }
예제 #2
0
            private bool stageIsComplete( )
            {
                if (terminationCondition.IsFinished( ) || isCancelled)
                {
                    return(true);
                }
                int count = currentPoint.SystemConfiguration.GetVariableNames( ).Length;

                for (int i = 0; i < count; i++)
                {
                    if ((moveSuccededOnce[i] == false) || (moveFailedOnce[i] == false))
                    {
                        return(false);
                    }
                }
                return(true);
            }