- Timestamp:
- 02/15/19 00:51:31 (6 years ago)
- Location:
- branches/2989_MovingPeaksBenchmark/HeuristicLab.Problems.MovingPeaksBenchmark/3.3
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2989_MovingPeaksBenchmark/HeuristicLab.Problems.MovingPeaksBenchmark/3.3/HeuristicLab.Problems.MovingPeaksBenchmark-3.3.csproj
r16606 r16607 52 52 <Compile Include="Plugin.cs" /> 53 53 <Compile Include="Properties\AssemblyInfo.cs" /> 54 <Compile Include="MovingPeaksBenchmarkProblemEvaluator.cs" /> 54 55 </ItemGroup> 55 56 <ItemGroup> -
branches/2989_MovingPeaksBenchmark/HeuristicLab.Problems.MovingPeaksBenchmark/3.3/Interfaces/IMovingPeaksBenchmarkProblemEvaluator.cs
r16606 r16607 30 30 /// </summary> 31 31 public interface IMovingPeaksBenchmarkProblemEvaluator : ISingleObjectiveEvaluator { 32 bool Maximization { get; } 33 DoubleMatrix Bounds { get; } 34 double BestKnownQuality { get; } 35 int MinimumProblemSize { get; } 36 int MaximumProblemSize { get; } 37 string FunctionName { get; } 38 32 ILookupParameter<DoubleMatrix> PeakLocationsParameter { get; } 33 ILookupParameter<DoubleArray> PeakWidthsParameter { get; } 34 ILookupParameter<DoubleArray> PeakHeightsParameter { get; } 39 35 ILookupParameter<RealVector> PointParameter { get; } 40 41 double Evaluate2D(double x, double y);42 double Evaluate(RealVector point);43 RealVector GetBestKnownSolution(int dimension);44 36 } 45 37 } -
branches/2989_MovingPeaksBenchmark/HeuristicLab.Problems.MovingPeaksBenchmark/3.3/MovingPeaksBenchmarkProblem.cs
r16606 r16607 42 42 public string Filename { get; set; } 43 43 44 [Storable]45 private StdDevStrategyVectorCreator strategyVectorCreator;46 [Storable]47 private StdDevStrategyVectorCrossover strategyVectorCrossover;48 [Storable]49 private StdDevStrategyVectorManipulator strategyVectorManipulator;44 //[Storable] 45 //private StdDevStrategyVectorCreator strategyVectorCreator; 46 //[Storable] 47 //private StdDevStrategyVectorCrossover strategyVectorCrossover; 48 //[Storable] 49 //private StdDevStrategyVectorManipulator strategyVectorManipulator; 50 50 51 51 #region Parameter Properties … … 55 55 public ValueParameter<IntValue> ProblemSizeParameter { 56 56 get { return (ValueParameter<IntValue>)Parameters["ProblemSize"]; } 57 } 58 public ValueParameter<IntValue> PeaksParameter { 59 get { return (ValueParameter<IntValue>)Parameters["Peaks"]; } 60 } 61 public ValueParameter<DoubleMatrix> PeakLocationsParameter { 62 get { return (ValueParameter<DoubleMatrix>)Parameters["PeakLocations"]; } 63 } 64 public ValueParameter<DoubleArray> PeakWidthsParameter { 65 get { return (ValueParameter<DoubleArray>)Parameters["PeakWidths"]; } 66 } 67 public ValueParameter<DoubleArray> PeakHeightsParameter { 68 get { return (ValueParameter<DoubleArray>)Parameters["PeakHeights"]; } 57 69 } 58 70 public OptionalValueParameter<RealVector> BestKnownSolutionParameter { … … 70 82 set { ProblemSizeParameter.Value = value; } 71 83 } 72 // private BestSingleObjectiveTestFunctionSolutionAnalyzer BestSingleObjectiveTestFunctionSolutionAnalyzer { 73 // get { return Operators.OfType<BestSingleObjectiveTestFunctionSolutionAnalyzer>().FirstOrDefault(); } 74 // } 84 public IntValue Peaks { 85 get { return PeaksParameter.Value; } 86 set { PeaksParameter.Value = value; } 87 } 88 public DoubleMatrix PeakLocations { 89 get { return PeakLocationsParameter.Value; } 90 set { PeakLocationsParameter.Value = value; } 91 } 92 public DoubleArray PeakWidths { 93 get { return PeakWidthsParameter.Value; } 94 set { PeakWidthsParameter.Value = value; } 95 } 96 public DoubleArray PeakHeights { 97 get { return PeakHeightsParameter.Value; } 98 set { PeakHeightsParameter.Value = value; } 99 } 100 // private BestSingleObjectiveTestFunctionSolutionAnalyzer BestSingleObjectiveTestFunctionSolutionAnalyzer { 101 // get { return Operators.OfType<BestSingleObjectiveTestFunctionSolutionAnalyzer>().FirstOrDefault(); } 102 // } 75 103 #endregion 76 104 … … 79 107 private MovingPeaksBenchmarkProblem(MovingPeaksBenchmarkProblem original, Cloner cloner) 80 108 : base(original, cloner) { 81 strategyVectorCreator = cloner.Clone(original.strategyVectorCreator);82 strategyVectorCrossover = cloner.Clone(original.strategyVectorCrossover);83 strategyVectorManipulator = cloner.Clone(original.strategyVectorManipulator);109 //strategyVectorCreator = cloner.Clone(original.strategyVectorCreator); 110 //strategyVectorCrossover = cloner.Clone(original.strategyVectorCrossover); 111 //strategyVectorManipulator = cloner.Clone(original.strategyVectorManipulator); 84 112 RegisterEventHandlers(); 85 113 } 86 114 public MovingPeaksBenchmarkProblem() 87 // : base(new AckleyEvaluator(), new UniformRandomRealVectorCreator()) { 88 : base(null, new UniformRandomRealVectorCreator()) { 89 Parameters.Add(new ValueParameter<DoubleMatrix>("Bounds", "The lower and upper bounds in each dimension.", Evaluator.Bounds)); 90 Parameters.Add(new ValueParameter<IntValue>("ProblemSize", "The dimension of the problem.", new IntValue(2))); 115 : base(new MovingPeaksBenchmarkProblemEvaluator(), new UniformRandomRealVectorCreator()) { 116 Parameters.Add(new ValueParameter<DoubleMatrix>("Bounds", "The lower and upper bounds in each dimension.", null)); 117 Parameters.Add(new ValueParameter<IntValue>("ProblemSize", "The dimension of the problem.", new IntValue(5))); 118 Parameters.Add(new ValueParameter<IntValue>("Peaks", "The number of peaks.", new IntValue(5))); 119 Parameters.Add(new ValueParameter<DoubleMatrix>("PeakLocations", "", null )); 120 Parameters.Add(new ValueParameter<DoubleArray>("PeakWidths", "", new DoubleArray(new double[] { 0, 0, 0, 0, 0 }))); 121 Parameters.Add(new ValueParameter<DoubleArray>("PeakHeights", "", new DoubleArray(new double[] { 0, 0, 0, 0, 0 }))); 122 91 123 Parameters.Add(new OptionalValueParameter<RealVector>("BestKnownSolution", "The best known solution for this test function instance.")); 92 124 93 Maximization.Value = Evaluator.Maximization;94 BestKnownQuality = new DoubleValue(Evaluator.BestKnownQuality);95 96 strategyVectorCreator = new StdDevStrategyVectorCreator();97 strategyVectorCreator.LengthParameter.ActualName = ProblemSizeParameter.Name;98 strategyVectorCrossover = new StdDevStrategyVectorCrossover();99 strategyVectorManipulator = new StdDevStrategyVectorManipulator();100 strategyVectorManipulator.LearningRateParameter.Value = new DoubleValue(0.5);101 strategyVectorManipulator.GeneralLearningRateParameter.Value = new DoubleValue(0.5);125 Maximization.Value = true; 126 //BestKnownQuality = new DoubleValue(Evaluator.BestKnownQuality); 127 128 //strategyVectorCreator = new StdDevStrategyVectorCreator(); 129 //strategyVectorCreator.LengthParameter.ActualName = ProblemSizeParameter.Name; 130 //strategyVectorCrossover = new StdDevStrategyVectorCrossover(); 131 //strategyVectorManipulator = new StdDevStrategyVectorManipulator(); 132 //strategyVectorManipulator.LearningRateParameter.Value = new DoubleValue(0.5); 133 //strategyVectorManipulator.GeneralLearningRateParameter.Value = new DoubleValue(0.5); 102 134 103 135 SolutionCreator.RealVectorParameter.ActualName = "Point"; -
branches/2989_MovingPeaksBenchmark/HeuristicLab.Problems.MovingPeaksBenchmark/3.3/Plugin.cs.frame
r16606 r16607 29 29 [Plugin("HeuristicLab.Problems.MovingPeaksBenchmark", "3.3.15.$WCREV$")] 30 30 // [PluginDependency("HeuristicLab.Analysis", "3.3")] 31 //[PluginDependency("HeuristicLab.Collections", "3.3")]32 //[PluginDependency("HeuristicLab.Common", "3.3")]31 [PluginDependency("HeuristicLab.Collections", "3.3")] 32 [PluginDependency("HeuristicLab.Common", "3.3")] 33 33 // [PluginDependency("HeuristicLab.Common.Resources", "3.3")] 34 34 [PluginDependency("HeuristicLab.Core", "3.3")] 35 //[PluginDependency("HeuristicLab.Data", "3.3")]36 //[PluginDependency("HeuristicLab.Encodings.RealVectorEncoding", "3.3")]37 //[PluginDependency("HeuristicLab.Operators", "3.3")]38 //[PluginDependency("HeuristicLab.Optimization", "3.3")]35 [PluginDependency("HeuristicLab.Data", "3.3")] 36 [PluginDependency("HeuristicLab.Encodings.RealVectorEncoding", "3.3")] 37 [PluginDependency("HeuristicLab.Operators", "3.3")] 38 [PluginDependency("HeuristicLab.Optimization", "3.3")] 39 39 // [PluginDependency("HeuristicLab.Optimization.Operators", "3.3")] 40 40 // [PluginDependency("HeuristicLab.Problems.Instances", "3.3")] 41 //[PluginDependency("HeuristicLab.Parameters", "3.3")]41 [PluginDependency("HeuristicLab.Parameters", "3.3")] 42 42 [PluginDependency("HeuristicLab.Persistence", "3.3")] 43 43 public class HeuristicLabProblemsMovingPeaksBenchmarkPlugin : PluginBase {
Note: See TracChangeset
for help on using the changeset viewer.