Changeset 16607


Ignore:
Timestamp:
02/15/19 00:51:31 (2 years ago)
Author:
swagner
Message:

#2989: Worked on Moving Peaks Benchmark

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  
    5252    <Compile Include="Plugin.cs" />
    5353    <Compile Include="Properties\AssemblyInfo.cs" />
     54    <Compile Include="MovingPeaksBenchmarkProblemEvaluator.cs" />
    5455  </ItemGroup>
    5556  <ItemGroup>
  • branches/2989_MovingPeaksBenchmark/HeuristicLab.Problems.MovingPeaksBenchmark/3.3/Interfaces/IMovingPeaksBenchmarkProblemEvaluator.cs

    r16606 r16607  
    3030  /// </summary>
    3131  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; }
    3935    ILookupParameter<RealVector> PointParameter { get; }
    40 
    41     double Evaluate2D(double x, double y);
    42     double Evaluate(RealVector point);
    43     RealVector GetBestKnownSolution(int dimension);
    4436  }
    4537}
  • branches/2989_MovingPeaksBenchmark/HeuristicLab.Problems.MovingPeaksBenchmark/3.3/MovingPeaksBenchmarkProblem.cs

    r16606 r16607  
    4242    public string Filename { get; set; }
    4343
    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;
    5050
    5151    #region Parameter Properties
     
    5555    public ValueParameter<IntValue> ProblemSizeParameter {
    5656      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"]; }
    5769    }
    5870    public OptionalValueParameter<RealVector> BestKnownSolutionParameter {
     
    7082      set { ProblemSizeParameter.Value = value; }
    7183    }
    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    //    }
    75103    #endregion
    76104
     
    79107    private MovingPeaksBenchmarkProblem(MovingPeaksBenchmarkProblem original, Cloner cloner)
    80108      : 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);
    84112      RegisterEventHandlers();
    85113    }
    86114    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
    91123      Parameters.Add(new OptionalValueParameter<RealVector>("BestKnownSolution", "The best known solution for this test function instance."));
    92124
    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);
    102134
    103135      SolutionCreator.RealVectorParameter.ActualName = "Point";
  • branches/2989_MovingPeaksBenchmark/HeuristicLab.Problems.MovingPeaksBenchmark/3.3/Plugin.cs.frame

    r16606 r16607  
    2929  [Plugin("HeuristicLab.Problems.MovingPeaksBenchmark", "3.3.15.$WCREV$")]
    3030//  [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")]
    3333//  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
    3434  [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")]
    3939//  [PluginDependency("HeuristicLab.Optimization.Operators", "3.3")]
    4040//  [PluginDependency("HeuristicLab.Problems.Instances", "3.3")]
    41 //  [PluginDependency("HeuristicLab.Parameters", "3.3")]
     41  [PluginDependency("HeuristicLab.Parameters", "3.3")]
    4242  [PluginDependency("HeuristicLab.Persistence", "3.3")]
    4343  public class HeuristicLabProblemsMovingPeaksBenchmarkPlugin : PluginBase {
Note: See TracChangeset for help on using the changeset viewer.