Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7480


Ignore:
Timestamp:
02/17/12 14:03:43 (13 years ago)
Author:
abeham
Message:

#1614

  • Fixed a parameter type in the GQAP
  • Fixed loading of ICTAP instances (only the upper triangular matrix is required for the distances)
  • Fixed a bug in the reducer that causes the loss of diversity
Location:
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/GeneralizedQuadraticAssignmentProblem.cs

    r7471 r7480  
    167167      Parameters.Add(new ValueParameter<DoubleArray>("Demands", DemandsDescription, new DoubleArray(), false));
    168168      Parameters.Add(new ValueParameter<DoubleArray>("Capacities", CapacitiesDescription, new DoubleArray(), false));
    169       Parameters.Add(new OptionalValueParameter<GQAPSolution>("BestKnownSolution", BestKnownSolutionDescription, null, false));
     169      Parameters.Add(new OptionalValueParameter<GQAPAssignment>("BestKnownSolution", BestKnownSolutionDescription, null, false));
    170170      Parameters.Add(new OptionalValueParameter<GQAPAssignmentArchive>("BestKnownSolutions", BestKnownSolutionsDescription, null, false));
    171171      Parameters.Add(new OptionalValueParameter<StringArray>("EquipmentNames", EquipmentNamesDescription, null, false));
     
    243243        Weights = new DoubleMatrix(instance.CommunicationCosts);
    244244        InstallationCosts = new DoubleMatrix(instance.ExecutionCosts.Transpose());
    245         Distances = new DoubleMatrix(Capacities.Length, Capacities.Length); // all one, except diagonal
     245        Distances = new DoubleMatrix(Capacities.Length, Capacities.Length);
    246246        for (int i = 0; i < Capacities.Length - 1; i++)
    247247          for (int j = i + 1; j < Capacities.Length; j++) {
    248248            Distances[i, j] = 1;
    249             Distances[j, i] = 1;
    250249          }
    251250
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/GQAPQualitySimilarityReducer.cs

    r7478 r7480  
    101101        if (!similarities.Any()) {
    102102          population.Add(candidate);
    103         } else if (population.Count < populationSize) {
    104           double maxSimilarity = similarities.Max();
    105           if (maxSimilarity < 1.0)
    106             population.Add(candidate);
     103          break;
     104        }
     105        if (similarities.Max() == 1.0) break;
     106        if (population.Count < populationSize) {
     107          population.Add(candidate);
    107108        } else {
    108109          var replacement = population.Select((v, i) => new { V = v, Index = i })
Note: See TracChangeset for help on using the changeset viewer.