- Timestamp:
- 07/23/17 11:17:18 (7 years ago)
- Location:
- branches/Async
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Async
- Property svn:ignore
-
old new 24 24 protoc.exe 25 25 obj 26 .vs
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/Async/HeuristicLab.Problems.QuadraticAssignment
- Property svn:mergeinfo changed
-
branches/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/Analyzers/BestQAPSolutionAnalyzer.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/Analyzers/QAPAlleleFrequencyAnalyzer.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/Analyzers/QAPPopulationDiversityAnalyzer.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 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/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/BoundsCalculators/GilmoreLawlerBoundCalculator.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPEvaluator.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPInversionMoveEvaluator.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPMoveEvaluator.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPScrambleMoveEvaluator.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPSwap2MoveEvaluator.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPTranslocationMoveEvaluator.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/Interfaces/IQAPEvaluator.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/Interfaces/IQAPMoveEvaluator.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPExhaustiveInsertionLocalImprovement.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPExhaustiveInversionLocalImprovement.cs
r12811 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPExhaustiveSwap2LocalImprovement.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/LocalImprovement/QAPStochasticScrambleLocalImprovement.cs
r12811 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/Plugin.cs.frame
r13321 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 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.14.$WCREV$")] 26 26 [PluginFile("HeuristicLab.Problems.QuadraticAssignment-3.3.dll", PluginFileType.Assembly)] 27 27 [PluginDependency("HeuristicLab.Analysis", "3.3")] -
branches/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/Properties/AssemblyInfo.cs.frame
r13321 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 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-2016 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.14.$WCREV$")] -
branches/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/QAPAssignment.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/QAPPermutationProximityCalculator.cs
r12012 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 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/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/QAPSimilarityCalculator.cs
r12070 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 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/Async/HeuristicLab.Problems.QuadraticAssignment/3.3/QuadraticAssignmentProblem.cs
r13173 r15281 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2016 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; … … 301 303 Operators.Add(new BestQAPSolutionAnalyzer()); 302 304 Operators.Add(new QAPAlleleFrequencyAnalyzer()); 303 Operators.Add(new QAPPopulationDiversityAnalyzer());304 305 305 306 Operators.Add(new QAPExhaustiveInsertionLocalImprovement()); … … 308 309 Operators.Add(new QAPExhaustiveSwap2LocalImprovement()); 309 310 311 Operators.Add(new HammingSimilarityCalculator()); 310 312 Operators.Add(new QAPSimilarityCalculator()); 313 Operators.Add(new QualitySimilarityCalculator()); 314 Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>())); 315 311 316 ParameterizeAnalyzers(); 312 317 ParameterizeOperators(); … … 393 398 } 394 399 395 QAPSimilarityCalculator similarityCalculator = Operators.OfType<QAPSimilarityCalculator>().SingleOrDefault(); 396 if (similarityCalculator != null) { 400 foreach (var similarityCalculator in Operators.OfType<ISolutionSimilarityCalculator>()) { 397 401 similarityCalculator.SolutionVariableName = SolutionCreator.PermutationParameter.ActualName; 398 402 similarityCalculator.QualityVariableName = Evaluator.QualityParameter.ActualName; 403 var qapsimcalc = similarityCalculator as QAPSimilarityCalculator; 404 if (qapsimcalc != null) { 405 qapsimcalc.Weights = Weights; 406 qapsimcalc.Distances = Distances; 407 } 399 408 } 400 409 }
Note: See TracChangeset
for help on using the changeset viewer.