Changeset 15086
- Timestamp:
- 06/29/17 11:39:20 (7 years ago)
- Location:
- trunk/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core.Views/3.3/CheckedItemListView.cs
r14185 r15086 106 106 var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as ICheckedItemList<T>; 107 107 if (data != null) 108 validDragOperation = Content.Select(x => x.ToString()).SequenceEqual(data.Select(x => x.ToString()));108 validDragOperation = true; 109 109 else 110 110 base.itemsListView_DragEnter(sender, e); … … 126 126 var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as ICheckedItemList<T>; 127 127 if (data != null) { 128 for (int i = 0; i < Content.Count; i++) { 129 Content.SetItemCheckedState(Content[i], data.ItemChecked(data[i])); 128 for (int i = 0; i < data.Count; i++) { 129 var dataItem = data[i]; 130 var contentItem = Content.FirstOrDefault(ci => ci.ToString() == dataItem.ToString()); 131 if (contentItem == null) continue; 132 Content.SetItemCheckedState(contentItem, data.ItemChecked(dataItem)); 130 133 } 131 134 } else -
trunk/sources/HeuristicLab.Optimization/3.3/MultiObjective/DominationCalculator.cs
r15080 r15086 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Core;25 using HeuristicLab.Data;26 24 27 25 namespace HeuristicLab.Optimization { … … 100 98 } 101 99 102 private static List<Tuple<T, double[]>> CalculateBestFront(T[] individuals, double[][] qualities, bool[] maximization, bool dominateOnEqualQualities, int populationSize, out Dictionary<T, List<int>> dominatedIndividuals, out int[] dominationCounter, out int[] rank) {100 private static List<Tuple<T, double[]>> CalculateBestFront(T[] solutions, double[][] qualities, bool[] maximization, bool dominateOnEqualQualities, int populationSize, out Dictionary<T, List<int>> dominatedIndividuals, out int[] dominationCounter, out int[] rank) { 103 101 var front = new List<Tuple<T, double[]>>(); 104 102 dominatedIndividuals = new Dictionary<T, List<int>>(); … … 106 104 rank = new int[populationSize]; 107 105 for (int pI = 0; pI < populationSize - 1; pI++) { 108 var p = individuals[pI];106 var p = solutions[pI]; 109 107 List<int> dominatedIndividualsByp; 110 108 if (!dominatedIndividuals.TryGetValue(p, out dominatedIndividualsByp)) … … 117 115 } else if (test == DominationResult.IsDominated) { 118 116 dominationCounter[pI] += 1; 119 if (!dominatedIndividuals.ContainsKey( individuals[qI]))120 dominatedIndividuals.Add( individuals[qI], new List<int>());121 dominatedIndividuals[ individuals[qI]].Add(pI);117 if (!dominatedIndividuals.ContainsKey(solutions[qI])) 118 dominatedIndividuals.Add(solutions[qI], new List<int>()); 119 dominatedIndividuals[solutions[qI]].Add(pI); 122 120 } 123 121 if (pI == populationSize - 2 … … 125 123 && dominationCounter[qI] == 0) { 126 124 rank[qI] = 0; 127 front.Add(Tuple.Create( individuals[qI], qualities[qI]));125 front.Add(Tuple.Create(solutions[qI], qualities[qI])); 128 126 } 129 127 }
Note: See TracChangeset
for help on using the changeset viewer.