# Changeset 13672

Ignore:
Timestamp:
03/09/16 12:44:23 (5 years ago)
Message:

Location:
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions
Files:
7 deleted
37 edited
5 moved

Unmodified
Removed

• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Calculators/GenerationalDistance.cs

 r13620 ﻿using System; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using System.Collections.Generic; using HeuristicLab.Encodings.RealVectorEncoding; using HeuristicLab.Problems.MultiObjectiveTestFunctions.Comparators; namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { ///  where d[i] is the minimal distance the ith point of the evaluated front has to any point in the optimal pareto front. /// public class GenerationalDistance : IMultiObjectiveDistance { private double p; //dampening Factor public class GenerationalDistance { public GenerationalDistance(double p) { this.p = 1 / p; } public static double GetDistance(IEnumerable front, IEnumerable optimalFront, double p) { return new GenerationalDistance(p).Compare(front,optimalFront); } public double Compare(IEnumerable front, IEnumerable optimalFront) { public static double Calculate(IEnumerable front, IEnumerable optimalFront, double p) { //TODO build a kd-tree, sort the array, do someting intelligent here if (front == null || optimalFront == null) throw new ArgumentException("Fronts must not be null"); double sum = 0; int c = 0; foreach(double[] r in front) { sum += Utilities.minDistance(r, optimalFront,true); foreach (double[] r in front) { sum += Utilities.minDistance(r, optimalFront, true); c++; } if (c == 0) throw new ArgumentException("Fronts must not be empty"); return Math.Pow(sum, p) /c; return Math.Pow(sum, 1 / p) / c; } }

• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Calculators/InvertedGenerationalDistance.cs

 r13620 ﻿using System; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System.Collections.Generic; using HeuristicLab.Encodings.RealVectorEncoding; using HeuristicLab.Problems.MultiObjectiveTestFunctions.Comparators; namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { /// /// The inverted generational Distance is defined as the mean of a all d[i]^(1/p), ///  where d[i] is the minimal distance the ith point of the optimal pareto front has to any point in the evaluated front. /// public class InvertedGenerationalDistance : IMultiObjectiveDistance { private double p; public class InvertedGenerationalDistance { public InvertedGenerationalDistance(double p) { if (p <= 0) throw new ArgumentOutOfRangeException("weighting factor p has to be greater than 0"); this.p = 1 / p; } /// /// /// /// /// /// /// public static double GetDistance(IEnumerable front, IEnumerable optimalFront, double p) { return new InvertedGenerationalDistance(p).Compare(front, optimalFront); } public double Compare(IEnumerable front, IEnumerable optimalFront) { return new GenerationalDistance(p).Compare(optimalFront, front); public static double Calculate(IEnumerable front, IEnumerable optimalFront, double p) { return GenerationalDistance.Calculate(optimalFront, front, p); } }

• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Drawings/MOFrontScatterPlotView.Designer.cs

 r13671 ﻿namespace HeuristicLab.Problems.MultiObjectiveTestFunctions.Drawings { ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { partial class MOQualitiesScatterPlotView { ///

• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Drawings/MOSolution.cs

 r13622 ﻿using System; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using System.Collections.Generic; using System.Drawing; using HeuristicLab.Common; using HeuristicLab.Optimization; using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; namespace HeuristicLab.Problems.MultiObjectiveTestFunctions.Drawings { namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { [StorableClass] class MOSolution : IMOQualities { class MOSolution : IMOFrontModel { public bool CanChangeDescription { get { } set {} set { } } get { return "MyFilename"; } set {} set { } } } set {} set { } } private IEnumerable qualities; private double[][] qualities; public IEnumerable Qualities { public double[][] Qualities { get { return qualities; set { qualities= value; qualities = value; } } } private Individual[] solutions; public Individual[] Solutions { private double[][] solutions; public double[][] Solutions { get { return solutions; } private IEnumerable paretoFront; public IEnumerable ParetoFront { private double[][] paretoFront; public double[][] ParetoFront { get { return paretoFront; [StorableConstructor] protected MOSolution(bool deserializing) : base(){ } protected MOSolution(MOSolution original) : base(){ protected MOSolution(bool deserializing) : base() { } protected MOSolution(MOSolution original) : base() { this.qualities = original.qualities; this.solutions = original.solutions; } protected MOSolution() : base() { } public MOSolution(IEnumerable qualities, Individual[] solutions, IEnumerable paretoFront, int objectives) { public MOSolution(double[][] qualities, double[][] solutions, double[][] paretoFront, int objectives) { this.qualities = qualities; this.solutions = solutions;
• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/HeuristicLab.Problems.MultiObjectiveTestFunctions-3.3.csproj

 r13622 v4.5512SvnSvnSvnSubversionScc UserControl MOQualitiesScatterPlotView.cs UserControl MOQulaitiesView.cs MOFrontScatterPlotView.cs MOQualitiesScatterPlotView.cs MOQulaitiesView.cs MOFrontScatterPlotView.cs
• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Interfaces/IMOFrontModel.cs

 r13671 ﻿using System.Collections.Generic; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using HeuristicLab.Common; using HeuristicLab.Core; using HeuristicLab.Optimization; namespace HeuristicLab.Problems.MultiObjectiveTestFunctions.Drawings { public interface IMOQualities :IItem, IStorableContent { namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { public interface IMOFrontModel : IItem, IStorableContent { int Objectives { get; set; } IEnumerable Qualities { get; set; } IEnumerable ParetoFront { get; set; } Individual[] Solutions { get; set; } double[][] Qualities { get; set; } double[][] ParetoFront { get; set; } double[][] Solutions { get; set; } } }

• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/NonDominatedSelect.cs

 r13620 public class NonDominatedSelect { private enum DominationResult { Dominates, IsDominated, IsNonDominated }; public static IEnumerable selectNonDominatedVectors(IEnumerable qualities, bool[] maximization, bool dominateOnEqualQualities) {

• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ.cs

 r13620 ﻿using System; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System.Collections.Generic; using HeuristicLab.Common; public override IEnumerable OptimalParetoFront(int objectives) { if (objectives == 2) return PFStore.get(this.ItemName); throw new NotImplementedException(); if (objectives == 2) return PFStore.get(this.ItemName + ".2D"); return null; } public override double[,] Bounds(int objectives) { return new double[,] { { 0, 1 } }; return new double[,] { { 0, 1 } }; } } public override int MaximumSolutionLength { get {return int.MaxValue;} get { return int.MaxValue; } } } public override int MaximumObjectives { get {return int.MaxValue;} get { return int.MaxValue; } } public override double[] ReferencePoint(int objectives) { double[] rp = new double[objectives]; for(int i = 0; i< objectives; i++) { for (int i = 0; i < objectives; i++) { rp[i] = 11; } [StorableConstructor] protected DTLZ(bool deserializing) : base(deserializing) { } protected DTLZ(DTLZ original, Cloner cloner) : base(original, cloner) {} public DTLZ() : base() { } protected DTLZ(DTLZ original, Cloner cloner) : base(original, cloner) { } public DTLZ() : base() { } public abstract override double[] Evaluate(RealVector r, int objecitves);
• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ1.cs

 r13620 ﻿using System; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using HeuristicLab.Common; using HeuristicLab.Core; public override double BestKnownHypervolume(int objectives) { if (objectives == 2)  return 120 + 7.0 / 8; if (objectives == 2) return 120 + 7.0 / 8; return -1; } [StorableConstructor] protected DTLZ1(bool deserializing) : base(deserializing) { } protected DTLZ1(DTLZ1 original, Cloner cloner) : base(original, cloner) {} protected DTLZ1(DTLZ1 original, Cloner cloner) : base(original, cloner) { } public DTLZ1() : base() { }
• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ2.cs

 r13620 ﻿using System; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using HeuristicLab.Common; using HeuristicLab.Core;
• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ3.cs

 r13620 ﻿using System; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using HeuristicLab.Common; using HeuristicLab.Core;
• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ4.cs

 r13620 ﻿using System; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using HeuristicLab.Common; using HeuristicLab.Core;
• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ5.cs

 r13620 ﻿using System; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using HeuristicLab.Common; using HeuristicLab.Core; for (int i = objectives; i < r.Length; i++) { double d = r[i] - 0.5; g += d*d; g += d * d; }
• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ6.cs

 r13620 ﻿using System; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using HeuristicLab.Common; using HeuristicLab.Core;
• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ7.cs

 r13620 ﻿using System; using System.Collections.Generic; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using HeuristicLab.Common; using HeuristicLab.Core;
• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/DTLZ/DTLZ8.cs

 r13620 ﻿using System; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using HeuristicLab.Common; using HeuristicLab.Core; public DTLZ8() : base() { } public  double[] Evaluate2(RealVector r, int objectives) { public double[] Evaluate2(RealVector r, int objectives) { if (r.Length < objectives) { throw new Exception("The dimensionality of the problem(ProblemSize) must be larger than or equal to ten times the dimensionality of the solution(SolutionSize) "); if (c != 0) { d *= 1.0 / c; } } res[i - 1] = d; } public override double[] Evaluate(RealVector r, int objectives) { if (r.Length < 10*objectives) throw new Exception("The dimensionality of the problem(ProblemSize) must be larger than or equal to ten times the dimensionality of the solution(SolutionSize) "); if (r.Length < 10 * objectives) throw new Exception("The dimensionality of the problem(ProblemSize) must be larger than ten times the number of objectives "); double n = r.Length; double M = objectives; double ratio = n / M; double[] res = new double[objectives]; for(int j =0; j < objectives; j++) { for (int j = 0; j < objectives; j++) { double sum = 0; for(int i = (int) (j*ratio); i < (j+1)+ratio; i++) { sum+=r[i]; for (int i = (int)(j * ratio); i < (j + 1) + ratio; i++) { sum += r[i]; } sum /= (int) ratio; sum /= (int)ratio; res[j] = sum; } for(int j = 0; j < M - 1; j++) { if(res[objectives - 1]+4*res[j]-1<0) return MultiObjectiveTestFunction.IllegalValue(objectives, Maximization(objectives)); for (int j = 0; j < M - 1; j++) { if (res[objectives - 1] + 4 * res[j] - 1 < 0) return MultiObjectiveTestFunction.IllegalValue(objectives, Maximization(objectives)); } double min = Double.PositiveInfinity; for(int i =0; i < res.Length - 1; i++) { for(int j = 0;j< i; j++) { for (int i = 0; i < res.Length - 1; i++) { for (int j = 0; j < i; j++) { double d = res[i] + res[j]; if (min < d) min = d; } if (2*res[objectives-1]+min-1<0) return MultiObjectiveTestFunction.IllegalValue(objectives, Maximization(objectives)); if (2 * res[objectives - 1] + min - 1 < 0) return MultiObjectiveTestFunction.IllegalValue(objectives, Maximization(objectives)); return res; }
• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/Fonseca.cs

 r13620 ﻿using System; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using System.Collections.Generic; using HeuristicLab.Common; using HeuristicLab.Core; using HeuristicLab.Data; using HeuristicLab.Encodings.RealVectorEncoding; using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; public override double[,] Bounds(int objectives) { return new double[,] { { -4, 4 } }; return new double[,] { { -4, 4 } }; } public override int MaximumSolutionLength { get {return int.MaxValue; } get { return int.MaxValue; } } public override int MinimumObjectives { get { return 2;  } get { return 2; } } public override IEnumerable OptimalParetoFront(int objectives) { return PFStore.get(this.ItemName); return PFStore.get(this.ItemName); } public override double BestKnownHypervolume(int objectives) { return new Hypervolume(ReferencePoint(objectives), Maximization(2)).GetHypervolume(OptimalParetoFront(objectives)); return Hypervolume.Calculate(OptimalParetoFront(objectives), ReferencePoint(objectives), Maximization(objectives)); }
• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/Kursawe.cs

 r13620 ﻿using System; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using System.Collections.Generic; using HeuristicLab.Common; using HeuristicLab.Core; using HeuristicLab.Data; using HeuristicLab.Encodings.RealVectorEncoding; using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; } public override int MaximumObjectives { get {return 2;} get { return 2; } } public override int MinimumSolutionLength { get {return 3;} get { return 3; } } public override int MaximumSolutionLength { public override IEnumerable OptimalParetoFront(int objecitves) { return PFStore.get(this.ItemName); return PFStore.get(this.ItemName); } public override double BestKnownHypervolume(int objecitves) { return new Hypervolume(ReferencePoint(objecitves), Maximization(2)).GetHypervolume(OptimalParetoFront(objecitves)); public override double BestKnownHypervolume(int objectives) { return Hypervolume.Calculate(OptimalParetoFront(objectives), ReferencePoint(objectives), Maximization(objectives)); } public override double[] ReferencePoint(int objectives) { public Kursawe() : base() { } //objective 1 double f0 = 0.0; for (int i = 0; i < r.Length-1; i++) { for (int i = 0; i < r.Length - 1; i++) { f0 += -10 * Math.Exp(-0.2 * Math.Sqrt(r[i] * r[i] + r[i + 1] * r[i + 1])); }
• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/MultiObjectiveTestFunction.cs

 r13620 ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. using HeuristicLab.Common; using HeuristicLab.Core; using HeuristicLab.Data; using HeuristicLab.Encodings.RealVectorEncoding; using HeuristicLab.Parameters; using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; public static double[] IllegalValue(int size, bool[] maximization) { double[] res = new double[size]; for(int i =0; i< size; i++) { for (int i = 0; i < size; i++) { res[i] = maximization[i] ? double.MinValue : double.MaxValue; } protected MultiObjectiveTestFunction(MultiObjectiveTestFunction original, Cloner cloner) : base(original, cloner) { this.objectives = original.objectives; Parameters.Add(new FixedValueParameter("MinimumObjectives", "The dimensionality of the problem instance (number of variables in the function).", new IntValue(MinimumObjectives))); Parameters.Add(new FixedValueParameter("MaximumObjectives", "The dimensionality of the problem instance (number of variables in the function).", new IntValue(MaximumObjectives))); Parameters.Add(new FixedValueParameter("MinimumSolutionLength", "The dimensionality of the problem instance (number of variables in the function).", new IntValue(MinimumSolutionLength))); Parameters.Add(new FixedValueParameter("MaximumSolutionLength", "The dimensionality of the problem instance (number of variables in the function).", new IntValue(MaximumSolutionLength))); } protected MultiObjectiveTestFunction() : base() { }
• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/SchafferN1.cs

 r13620 ﻿using System; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using System.Collections.Generic; using HeuristicLab.Common; using HeuristicLab.Core; using HeuristicLab.Data; using HeuristicLab.Encodings.RealVectorEncoding; using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; public override double[] ReferencePoint(int objecitves) { return new double[] { 1e5, 1e5 }; return new double[] { 1e5, 1e5 }; } public override IEnumerable OptimalParetoFront(int objecitves) { return PFStore.get("Schaffer"); return PFStore.get("Schaffer"); } public override double BestKnownHypervolume(int objecitves) { return new Hypervolume(ReferencePoint(objecitves), Maximization(2)).GetHypervolume(OptimalParetoFront(objecitves)); public override double BestKnownHypervolume(int objectives) { return Hypervolume.Calculate(OptimalParetoFront(objectives), ReferencePoint(objectives), Maximization(objectives)); } public SchafferN1() : base() { } public override double[] Evaluate(RealVector r, int objectives) {
• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/SchafferN2.cs

 r13620 ﻿using System; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using System.Collections.Generic; using HeuristicLab.Common; using HeuristicLab.Core; using HeuristicLab.Data; using HeuristicLab.Encodings.RealVectorEncoding; using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/ZDT/ZDT.cs

 r13622 ﻿using System; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using System.Collections.Generic; using HeuristicLab.Common; namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { [StorableClass] public abstract class ZDT:MultiObjectiveTestFunction { public abstract class ZDT : MultiObjectiveTestFunction { public override IEnumerable OptimalParetoFront(int objectives) { if(objectives==2)  return PFStore.get(this.ItemName); throw new NotImplementedException(); return PFStore.get(this.ItemName); } } public override bool[] Maximization (int objectives){ return new bool[objectives]; public override bool[] Maximization(int objectives) { return new bool[objectives]; }

• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/ZDT/ZDT2.cs

 r13620 ﻿using HeuristicLab.Common; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using HeuristicLab.Common; using HeuristicLab.Core; using HeuristicLab.Encodings.RealVectorEncoding; [StorableClass] public class ZDT2 : ZDT { public override double BestKnownHypervolume(int objectives) { return 120+1.0/3; return 120 + 1.0 / 3; } g = 1.0 + 9.0 * g / (r.Length - 1); double d = r[0] / g; return new double[] { r[0], g * (1.0 - d * d) }; double f0 = r[0]; double f1 = g * (1.0 - d * d); return new double[] { f0, f1 }; } }
• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/ZDT/ZDT3.cs

 r13620 ﻿using System; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using HeuristicLab.Common; using HeuristicLab.Core; g = 1.0 + 9.0 * g / (r.Length - 1); double d = r[0] / g; return new double[] { r[0], g * (1.0 - Math.Sqrt(d) - d * Math.Sin(10 * Math.PI * r[0])) }; double f0 = r[0]; double f1 = g * (1.0 - Math.Sqrt(d) - d * Math.Sin(10 * Math.PI * r[0])); return new double[] { f0, f1 }; } }
• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/ZDT/ZDT4.cs

 r13620 ﻿using System; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using HeuristicLab.Common; using HeuristicLab.Core; g = 1.0 + 10.0 * (r.Length - 1) + g; double d = r[0] / g; return new double[] { r[0], 1-Math.Sqrt(d) }; double f0 = r[0]; double f1 = 1 - Math.Sqrt(d); return new double[] { f0, f1 }; } }
• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Testfunctions/ZDT/ZDT6.cs

 r13620 ﻿using System; ﻿#region License Information /* HeuristicLab * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using HeuristicLab.Common; using HeuristicLab.Core; double f1 = 1 - Math.Exp(-4 * r[0]) * Math.Pow(Math.Sin(6 * Math.PI * r[0]), 6); double d = f1 / g; return new double[] { f1, g*(1.0 - d * d) }; double f2 = g * (1.0 - d * d); return new double[] { f1, f2 }; } }
• ## branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/MultiObjectiveTestFunctions.sln

 r13421 EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultiObjectiveTestfunctionTests", "MultiObjectiveTestfunctionTests\MultiObjectiveTestfunctionTests.csproj", "{2E42C743-37B3-494F-B30D-EDB0069D73C1}" EndProject Global GlobalSection(SubversionScc) = preSolution Svn-Managed = True Manager = AnkhSVN - Subversion Support for Visual Studio EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU {D53E8E48-CFAA-4F57-AC35-63BEF4476159}.Release|Any CPU.ActiveCfg = Release|Any CPU {D53E8E48-CFAA-4F57-AC35-63BEF4476159}.Release|Any CPU.Build.0 = Release|Any CPU {2E42C743-37B3-494F-B30D-EDB0069D73C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2E42C743-37B3-494F-B30D-EDB0069D73C1}.Debug|Any CPU.Build.0 = Debug|Any CPU {2E42C743-37B3-494F-B30D-EDB0069D73C1}.Release|Any CPU.ActiveCfg = Release|Any CPU {2E42C743-37B3-494F-B30D-EDB0069D73C1}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution
Note: See TracChangeset for help on using the changeset viewer.