Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13851


Ignore:
Timestamp:
05/18/16 17:52:11 (8 years ago)
Author:
ichiriac
Message:

Add licence information

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ichiriac/HeuristicLab.Algorithms.DifferentialEvolution/DifferentialEvolution.cs

    r13770 r13851  
    1 using HeuristicLab.Analysis;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 * Implementation is based on jMetal framework https://github.com/jMetal/jMetal
     7 *
     8 * HeuristicLab is free software: you can redistribute it and/or modify
     9 * it under the terms of the GNU General Public License as published by
     10 * the Free Software Foundation, either version 3 of the License, or
     11 * (at your option) any later version.
     12 *
     13 * HeuristicLab is distributed in the hope that it will be useful,
     14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16 * GNU General Public License for more details.
     17 *
     18 * You should have received a copy of the GNU General Public License
     19 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     20 */
     21#endregion
     22using HeuristicLab.Analysis;
    223using HeuristicLab.Common;
    324using HeuristicLab.Core;
     
    175196            Parameters.Add(new FixedValueParameter<IntValue>(SeedParameterName, "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
    176197            Parameters.Add(new FixedValueParameter<BoolValue>(SetSeedRandomlyParameterName, "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
    177             Parameters.Add(new ValueParameter<IntValue>(PopulationSizeParameterName, "The size of the population of solutions.", new IntValue(75)));
     198            Parameters.Add(new ValueParameter<IntValue>(PopulationSizeParameterName, "The size of the population of solutions.", new IntValue(100)));
    178199            Parameters.Add(new ValueParameter<DoubleValue>(CrossoverProbabilityParameterName, "The value for crossover rate", new DoubleValue(0.88)));
    179200            Parameters.Add(new ValueParameter<DoubleValue>(ScalingFactorParameterName, "The value for scaling factor", new DoubleValue(0.47)));
    180             Parameters.Add(new ValueParameter<DoubleValue>(ValueToReachParameterName, "Value to reach (VTR) parameter", new DoubleValue(0.000001)));
     201            Parameters.Add(new ValueParameter<DoubleValue>(ValueToReachParameterName, "Value to reach (VTR) parameter", new DoubleValue(0.00000001)));
    181202        }
    182203
     
    201222            var range = ub - lb;
    202223            this.evals = 0;
     224
    203225            double[,] populationOld = new double[PopulationSizeParameter.Value.Value, Problem.ProblemSize.Value];
    204226            double[,] mutationPopulation = new double[PopulationSizeParameter.Value.Value, Problem.ProblemSize.Value];
     
    252274            // Loop until iteration limit reached or canceled.
    253275            // todo replace with a function
    254             while (ResultsIterations < MaximumEvaluations
     276            // && bestPopulationValue > Problem.BestKnownQuality.Value + ValueToReachParameter.Value.Value
     277            while (ResultsEvaluations < MaximumEvaluations
    255278                && !cancellationToken.IsCancellationRequested
    256                 && bestPopulationValue > Problem.BestKnownQuality.Value + ValueToReachParameter.Value.Value)
     279                && (bestPopulationValue - Problem.BestKnownQuality.Value) > ValueToReachParameter.Value.Value)
    257280            {
    258 
    259281                //mutation DE/rand/1/bin; classic DE
    260282                for (int i = 0; i < PopulationSizeParameter.Value.Value; i++)
Note: See TracChangeset for help on using the changeset viewer.