Changeset 11791 for branches/Parameter-less Population Pyramid/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/HillClimber.cs
- Timestamp:
- 01/16/15 14:39:15 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Parameter-less Population Pyramid/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/HillClimber.cs
r11672 r11791 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using System.Linq; 25 using System.Threading; 24 26 using HeuristicLab.Common; 25 27 using HeuristicLab.Core; 26 28 using HeuristicLab.Data; 27 using HeuristicLab.Encodings.BinaryVectorEncoding;28 29 using HeuristicLab.Optimization; 29 30 using HeuristicLab.Parameters; … … 37 38 [Creatable("Parameterless Population Pyramid")] 38 39 // In the GECCO paper, Section 2.1 39 public class HillClimber : AlgorithmBase{40 public class HillClimber : BasicAlgorithm { 40 41 [Storable] 41 42 private IRandom random; 42 43 43 44 private const string IterationsParameterName = "Iterations"; 45 46 public override Type ProblemType { 47 get { return typeof(BinaryVectorProblem); } 48 } 49 public new BinaryVectorProblem Problem { 50 get { return (BinaryVectorProblem)base.Problem; } 51 set { base.Problem = value; } 52 } 44 53 45 54 public IFixedValueParameter<IntValue> IterationsParameter { … … 66 75 Parameters.Add(new FixedValueParameter<IntValue>(IterationsParameterName, "", new IntValue(100))); 67 76 } 68 protected override void Run( ) {77 protected override void Run(CancellationToken cancellationToken) { 69 78 var BestQuality = new DoubleValue(double.NaN); 70 79 Results.Add(new Result("Best quality", BestQuality));
Note: See TracChangeset
for help on using the changeset viewer.