Changeset 13851 for branches/ichiriac
- Timestamp:
- 05/18/16 17:52:11 (9 years ago)
- 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 22 using HeuristicLab.Analysis; 2 23 using HeuristicLab.Common; 3 24 using HeuristicLab.Core; … … 175 196 Parameters.Add(new FixedValueParameter<IntValue>(SeedParameterName, "The random seed used to initialize the new pseudo random number generator.", new IntValue(0))); 176 197 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))); 178 199 Parameters.Add(new ValueParameter<DoubleValue>(CrossoverProbabilityParameterName, "The value for crossover rate", new DoubleValue(0.88))); 179 200 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.00000 1)));201 Parameters.Add(new ValueParameter<DoubleValue>(ValueToReachParameterName, "Value to reach (VTR) parameter", new DoubleValue(0.00000001))); 181 202 } 182 203 … … 201 222 var range = ub - lb; 202 223 this.evals = 0; 224 203 225 double[,] populationOld = new double[PopulationSizeParameter.Value.Value, Problem.ProblemSize.Value]; 204 226 double[,] mutationPopulation = new double[PopulationSizeParameter.Value.Value, Problem.ProblemSize.Value]; … … 252 274 // Loop until iteration limit reached or canceled. 253 275 // todo replace with a function 254 while (ResultsIterations < MaximumEvaluations 276 // && bestPopulationValue > Problem.BestKnownQuality.Value + ValueToReachParameter.Value.Value 277 while (ResultsEvaluations < MaximumEvaluations 255 278 && !cancellationToken.IsCancellationRequested 256 && bestPopulationValue > Problem.BestKnownQuality.Value +ValueToReachParameter.Value.Value)279 && (bestPopulationValue - Problem.BestKnownQuality.Value) > ValueToReachParameter.Value.Value) 257 280 { 258 259 281 //mutation DE/rand/1/bin; classic DE 260 282 for (int i = 0; i < PopulationSizeParameter.Value.Value; i++)
Note: See TracChangeset
for help on using the changeset viewer.