Пример #1
0
        public RealGaussianMutation(List <double> sigmas, IEvaluationProfile <double> evaluationProfile, int?seed = null, double probability = 1.0)
            : base(probability, evaluationProfile)
        {
            uniformRNG  = new BoolRandom(seed);
            gaussianRNG = new NormalRealRandom(seed);

            this.sigmas = new List <double>(sigmas);
        }
Пример #2
0
        public RealGaussianMutation(double sigma, IEvaluationProfile <double> evaluationProfile, int?seed = null, double probability = 1.0)
            : base(probability, evaluationProfile)
        {
            uniformRNG  = new BoolRandom(seed);
            gaussianRNG = new NormalRealRandom(seed);

            sigmas = new List <double>(evaluationProfile.iSize);
            for (int i = 0; i < evaluationProfile.iSize; ++i)
            {
                sigmas.Add(sigma);
            }
        }
Пример #3
0
        public CMAES(IEvaluation <double> evaluation, AStopCondition stopCondition, double initSigma, int?seed = null)
            : base(evaluation, stopCondition)
        {
            this.initSigma = initSigma;

            normalRNG     = new NormalRealRandom(seed);
            realGenerator = new RealRandomGenerator(evaluation.pcConstraint, seed);

            int N = evaluation.iSize;

            previousMeans = Vector <double> .Build.Dense(N);

            means = Vector <double> .Build.Dense(N);

            covarianceMatrix = Matrix <double> .Build.Dense(N, N);

            selectionParameters  = new SelectionParameters(N);
            stepSizeParameters   = new StepSizeParameters(N, initSigma);
            adaptationParameters = new AdaptationParameters(N, selectionParameters);

            sampledPopulation = new List <Individual>(selectionParameters.Lambda);
        }