- Timestamp:
- 03/03/15 11:18:07 (10 years ago)
- Location:
- branches/HeuristicLab.DatasetRefactor/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DatasetRefactor/sources
- Property svn:mergeinfo changed
/trunk/sources merged: 12037,12041,12057,12059-12060,12067,12069-12070,12072,12074,12076-12078,12085,12087-12091,12093,12095-12096,12100-12104
- Property svn:mergeinfo changed
-
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.Knapsack/3.3/KnapsackProblem.cs
r12031 r12105 29 29 using HeuristicLab.Encodings.BinaryVectorEncoding; 30 30 using HeuristicLab.Optimization; 31 using HeuristicLab.Optimization.Operators; 31 32 using HeuristicLab.Parameters; 32 33 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 81 82 private BestKnapsackSolutionAnalyzer BestKnapsackSolutionAnalyzer { 82 83 get { return Operators.OfType<BestKnapsackSolutionAnalyzer>().FirstOrDefault(); } 83 }84 private SingleObjectivePopulationDiversityAnalyzer SingleObjectivePopulationDiversityAnalyzer {85 get { return Operators.OfType<SingleObjectivePopulationDiversityAnalyzer>().FirstOrDefault(); }86 84 } 87 85 #endregion … … 248 246 BestKnapsackSolutionAnalyzer.ValuesParameter.Hidden = true; 249 247 } 250 251 if (SingleObjectivePopulationDiversityAnalyzer != null) {252 SingleObjectivePopulationDiversityAnalyzer.MaximizationParameter.ActualName = MaximizationParameter.Name;253 SingleObjectivePopulationDiversityAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;254 SingleObjectivePopulationDiversityAnalyzer.ResultsParameter.ActualName = "Results";255 SingleObjectivePopulationDiversityAnalyzer.SimilarityCalculator = Operators.OfType<KnapsackSimilarityCalculator>().SingleOrDefault();256 }257 248 } 258 249 private void InitializeOperators() { … … 261 252 Operators.Add(new KnapsackSimultaneousPathRelinker()); 262 253 Operators.Add(new KnapsackSimilarityCalculator()); 254 Operators.Add(new QualitySimilarityCalculator { QualityVariableName = SolutionCreator.BinaryVectorParameter.ActualName }); 255 Operators.Add(new NoSimilarityCalculator()); 263 256 264 257 Operators.Add(new BestKnapsackSolutionAnalyzer()); 265 Operators.Add(new SingleObjectivePopulationDiversityAnalyzer());258 Operators.Add(new PopulationSimilarityAnalyzer(Operators.OfType<ISolutionSimilarityCalculator>())); 266 259 ParameterizeAnalyzer(); 267 260 foreach (IBinaryVectorOperator op in ApplicationManager.Manager.GetInstances<IBinaryVectorOperator>()) { -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.Knapsack/3.3/SimilarityCalculators/KnapsackSimilarityCalculator.cs
r12031 r12105 35 35 [Item("KnapsackSimilarityCalculator", "An operator that performs similarity calculation between two knapsack solutions. The operator calculates the similarity based on the number of elements the two solutions have in common.")] 36 36 public sealed class KnapsackSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator { 37 protected override bool IsCommutative { get { return true; } } 38 37 39 private KnapsackSimilarityCalculator(bool deserializing) : base(deserializing) { } 38 40 private KnapsackSimilarityCalculator(KnapsackSimilarityCalculator original, Cloner cloner) : base(original, cloner) { }
Note: See TracChangeset
for help on using the changeset viewer.