Changeset 7480
- Timestamp:
- 02/17/12 14:03:43 (13 years ago)
- 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 167 167 Parameters.Add(new ValueParameter<DoubleArray>("Demands", DemandsDescription, new DoubleArray(), false)); 168 168 Parameters.Add(new ValueParameter<DoubleArray>("Capacities", CapacitiesDescription, new DoubleArray(), false)); 169 Parameters.Add(new OptionalValueParameter<GQAP Solution>("BestKnownSolution", BestKnownSolutionDescription, null, false));169 Parameters.Add(new OptionalValueParameter<GQAPAssignment>("BestKnownSolution", BestKnownSolutionDescription, null, false)); 170 170 Parameters.Add(new OptionalValueParameter<GQAPAssignmentArchive>("BestKnownSolutions", BestKnownSolutionsDescription, null, false)); 171 171 Parameters.Add(new OptionalValueParameter<StringArray>("EquipmentNames", EquipmentNamesDescription, null, false)); … … 243 243 Weights = new DoubleMatrix(instance.CommunicationCosts); 244 244 InstallationCosts = new DoubleMatrix(instance.ExecutionCosts.Transpose()); 245 Distances = new DoubleMatrix(Capacities.Length, Capacities.Length); // all one, except diagonal245 Distances = new DoubleMatrix(Capacities.Length, Capacities.Length); 246 246 for (int i = 0; i < Capacities.Length - 1; i++) 247 247 for (int j = i + 1; j < Capacities.Length; j++) { 248 248 Distances[i, j] = 1; 249 Distances[j, i] = 1;250 249 } 251 250 -
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/GQAPQualitySimilarityReducer.cs
r7478 r7480 101 101 if (!similarities.Any()) { 102 102 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); 107 108 } else { 108 109 var replacement = population.Select((v, i) => new { V = v, Index = i })
Note: See TracChangeset
for help on using the changeset viewer.