- Timestamp:
- 03/18/19 17:24:30 (6 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:ignore
-
old new 24 24 protoc.exe 25 25 obj 26 .vs
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/Analyzers/BestQAPSolutionAnalyzer.cs
r13396 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/Analyzers/QAPAlleleFrequencyAnalyzer.cs
r13396 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/Analyzers/QAPPopulationDiversityAnalyzer.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Analysis; 23 24 using HeuristicLab.Common; … … 27 28 using HeuristicLab.Parameters; 28 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.PluginInfrastructure; 29 31 30 32 namespace HeuristicLab.Problems.QuadraticAssignment { … … 34 36 [Item("QAPPopulationDiversityAnalyzer", "An operator for analyzing the diversity of solutions of Quadratic Assignment Problems regarding their structural identity (number of equal facilty->location assignments).")] 35 37 [StorableClass] 36 public sealed class QAPPopulationDiversityAnalyzer : PopulationDiversityAnalyzer<Permutation> { 38 [Obsolete("Use the PopulationSimilarityAnalyzer in the HeuristicLab.Analysis plugin instead.")] 39 [NonDiscoverableType] 40 #pragma warning disable 0612 41 internal sealed class QAPPopulationDiversityAnalyzer : PopulationDiversityAnalyzer<Permutation> { 42 #pragma warning restore 0612 37 43 public IValueParameter<BoolValue> UsePhenotypeSimilarityParameter { 38 44 get { return (IValueParameter<BoolValue>)Parameters["UsePhenotypeSimilarity"]; } … … 83 89 if (phenotypeSimilarity) 84 90 similarities[i, j] = QAPPermutationProximityCalculator.CalculatePhenotypeSimilarity(solutions[i], solutions[j], weights, distances); 85 else similarities[i, j] = QAPPermutationProximityCalculator.CalculateGenotypeSimilarity(solutions[i], solutions[j]);91 else similarities[i, j] = HammingSimilarityCalculator.CalculateSimilarity(solutions[i], solutions[j]); 86 92 similarities[j, i] = similarities[i, j]; 87 93 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/BoundsCalculators/GilmoreLawlerBoundCalculator.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPInversionMoveEvaluator.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPMoveEvaluator.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPScrambleMoveEvaluator.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPSwap2MoveEvaluator.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPTranslocationMoveEvaluator.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/Interfaces/IQAPLocalImprovementOperator.cs
r13396 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/Interfaces/IQAPMoveEvaluator.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPExhaustiveInsertionLocalImprovement.cs
r13396 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPExhaustiveInversionLocalImprovement.cs
r13396 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPExhaustiveSwap2LocalImprovement.cs
r13396 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPStochasticScrambleLocalImprovement.cs
r13396 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/Plugin.cs.frame
r13321 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 24 24 namespace HeuristicLab.Problems.QuadraticAssignment { 25 [Plugin("HeuristicLab.Problems.QuadraticAssignment", "3.3.1 3.$WCREV$")]25 [Plugin("HeuristicLab.Problems.QuadraticAssignment", "3.3.15.$WCREV$")] 26 26 [PluginFile("HeuristicLab.Problems.QuadraticAssignment-3.3.dll", PluginFileType.Assembly)] 27 27 [PluginDependency("HeuristicLab.Analysis", "3.3")] -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/Properties/AssemblyInfo.cs.frame
r13321 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 32 32 [assembly: AssemblyCompany("HEAL")] 33 33 [assembly: AssemblyProduct("HeuristicLab")] 34 [assembly: AssemblyCopyright("(c) 2002-201 5HEAL")]34 [assembly: AssemblyCopyright("(c) 2002-2018 HEAL")] 35 35 [assembly: AssemblyTrademark("")] 36 36 [assembly: AssemblyCulture("")] … … 55 55 // [assembly: AssemblyVersion("1.0.*")] 56 56 [assembly: AssemblyVersion("3.3.0.0")] 57 [assembly: AssemblyFileVersion("3.3.1 3.$WCREV$")]57 [assembly: AssemblyFileVersion("3.3.15.$WCREV$")] -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/QAPAssignment.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/QAPPermutationProximityCalculator.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 26 26 namespace HeuristicLab.Problems.QuadraticAssignment { 27 27 public static class QAPPermutationProximityCalculator { 28 29 public static double CalculateGenotypeSimilarity(Permutation a, Permutation b) {30 int similar = 0;31 for (int i = 0; i < a.Length; i++) {32 if (a[i] == b[i]) similar++;33 }34 return similar / (double)a.Length;35 }36 37 public static double CalculateGenotypeDistance(Permutation a, Permutation b) {38 return 1.0 - CalculateGenotypeSimilarity(a, b);39 }40 28 41 29 public static double CalculatePhenotypeSimilarity(Permutation a, Permutation b, DoubleMatrix weights, DoubleMatrix distances) { -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/QAPSimilarityCalculator.cs
r12070 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 using HeuristicLab.Common; 24 24 using HeuristicLab.Core; 25 using HeuristicLab.Data; 25 26 using HeuristicLab.Encodings.PermutationEncoding; 26 27 using HeuristicLab.Optimization.Operators; 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 29 28 30 namespace HeuristicLab.Problems.QuadraticAssignment { … … 34 36 /// </remarks> 35 37 [Item("QAPSimilarityCalculator", "An operator that performs similarity calculation between two quadratic assignment solutions. The operator calculates the similarity based on the number of edges the two solutions have in common.")] 38 [StorableClass] 36 39 public sealed class QAPSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator { 37 40 protected override bool IsCommutative { get { return true; } } 38 41 42 [Storable] 43 public DoubleMatrix Weights { get; set; } 44 [Storable] 45 public DoubleMatrix Distances { get; set; } 46 39 47 private QAPSimilarityCalculator(bool deserializing) : base(deserializing) { } 40 private QAPSimilarityCalculator(QAPSimilarityCalculator original, Cloner cloner) : base(original, cloner) { } 48 private QAPSimilarityCalculator(QAPSimilarityCalculator original, Cloner cloner) 49 : base(original, cloner) { 50 Weights = cloner.Clone(original.Weights); 51 Distances = cloner.Clone(original.Distances); 52 } 41 53 public QAPSimilarityCalculator() : base() { } 42 54 … … 45 57 } 46 58 47 public static double CalculateSimilarity(Permutation left, Permutation right ) {59 public static double CalculateSimilarity(Permutation left, Permutation right, DoubleMatrix weights, DoubleMatrix distances) { 48 60 if (left == null || right == null) 49 61 throw new ArgumentException("Cannot calculate similarity because one of the provided solutions or both are null."); 50 62 if (left.Length != right.Length) 51 63 throw new ArgumentException("Cannot calculate similarity because the provided solutions have different lengths."); 52 if (object.ReferenceEquals(left, right)) return 1.0; 64 if (left.Length == 0) 65 throw new ArgumentException("Cannot calculate similarity because solutions are of length 0."); 66 if (ReferenceEquals(left, right)) return 1.0; 53 67 54 return QAPPermutationProximityCalculator.Calculate GenotypeSimilarity(left, right);68 return QAPPermutationProximityCalculator.CalculatePhenotypeSimilarity(left, right, weights, distances); 55 69 } 56 70 … … 59 73 var sol2 = rightSolution.Variables[SolutionVariableName].Value as Permutation; 60 74 61 return CalculateSimilarity(sol1, sol2 );75 return CalculateSimilarity(sol1, sol2, Weights, Distances); 62 76 } 63 77 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.QuadraticAssignment/3.3/QuadraticAssignmentProblem.cs
r13469 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 24 24 using System.Drawing; 25 25 using System.Linq; 26 using HeuristicLab.Analysis; 26 27 using HeuristicLab.Common; 27 28 using HeuristicLab.Core; … … 29 30 using HeuristicLab.Encodings.PermutationEncoding; 30 31 using HeuristicLab.Optimization; 32 using HeuristicLab.Optimization.Operators; 31 33 using HeuristicLab.Parameters; 32 34 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 253 255 Operators.Add(new BestQAPSolutionAnalyzer()); 254 256 Operators.Add(new QAPAlleleFrequencyAnalyzer()); 255 Operators.Add(new QAPPopulationDiversityAnalyzer()); 256 257 258 Operators.Add(new HammingSimilarityCalculator()); 257 259 Operators.Add(new QAPSimilarityCalculator()); 260 Operators.Add(new QualitySimilarityCalculator()); 261 Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>())); 258 262 Parameterize(); 259 263 } … … 321 325 } 322 326 } 323 var similarityCalculator = Operators.OfType<QAPSimilarityCalculator>().SingleOrDefault(); 324 if (similarityCalculator != null) { 327 foreach (var similarityCalculator in Operators.OfType<ISolutionSimilarityCalculator>()) { 325 328 similarityCalculator.SolutionVariableName = Encoding.Name; 326 329 similarityCalculator.QualityVariableName = Evaluator.QualityParameter.ActualName; 330 var qapsimcalc = similarityCalculator as QAPSimilarityCalculator; 331 if (qapsimcalc != null) { 332 qapsimcalc.Weights = Weights; 333 qapsimcalc.Distances = Distances; 334 } 327 335 } 328 336
Note: See TracChangeset
for help on using the changeset viewer.