Free cookie consent management tool by TermsFeed Policy Generator

Changeset 15086


Ignore:
Timestamp:
06/29/17 11:39:20 (7 years ago)
Author:
mkommend
Message:

#2783: Renamed individuals to solutions in DominationCalculator to be consistent with other methods.

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core.Views/3.3/CheckedItemListView.cs

    r14185 r15086  
    106106      var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as ICheckedItemList<T>;
    107107      if (data != null)
    108         validDragOperation = Content.Select(x => x.ToString()).SequenceEqual(data.Select(x => x.ToString()));
     108        validDragOperation = true;
    109109      else
    110110        base.itemsListView_DragEnter(sender, e);
     
    126126      var data = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as ICheckedItemList<T>;
    127127      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));
    130133        }
    131134      } else
  • trunk/sources/HeuristicLab.Optimization/3.3/MultiObjective/DominationCalculator.cs

    r15080 r15086  
    2222using System;
    2323using System.Collections.Generic;
    24 using HeuristicLab.Core;
    25 using HeuristicLab.Data;
    2624
    2725namespace HeuristicLab.Optimization {
     
    10098    }
    10199
    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) {
    103101      var front = new List<Tuple<T, double[]>>();
    104102      dominatedIndividuals = new Dictionary<T, List<int>>();
     
    106104      rank = new int[populationSize];
    107105      for (int pI = 0; pI < populationSize - 1; pI++) {
    108         var p = individuals[pI];
     106        var p = solutions[pI];
    109107        List<int> dominatedIndividualsByp;
    110108        if (!dominatedIndividuals.TryGetValue(p, out dominatedIndividualsByp))
     
    117115          } else if (test == DominationResult.IsDominated) {
    118116            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);
    122120          }
    123121          if (pI == populationSize - 2
     
    125123            && dominationCounter[qI] == 0) {
    126124            rank[qI] = 0;
    127             front.Add(Tuple.Create(individuals[qI], qualities[qI]));
     125            front.Add(Tuple.Create(solutions[qI], qualities[qI]));
    128126          }
    129127        }
Note: See TracChangeset for help on using the changeset viewer.