Changeset 7418 for branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Analyzers
- Timestamp:
- 01/27/12 02:01:25 (13 years ago)
- Location:
- branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Analyzers
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Analyzers/BestGQAPSolutionAnalyzer.cs
r7415 r7418 130 130 } 131 131 132 [StorableHook(HookType.AfterDeserialization)]133 private void AfterDeserialization() {134 // BackwardsCompatibility3.3135 #region Backwards compatible code, remove with 3.4136 if (!Parameters.ContainsKey("EquipmentNames"))137 Parameters.Add(new LookupParameter<StringArray>("EquipmentNames", "Optional: A list of names that describes the equipments."));138 if (!Parameters.ContainsKey("LocationNames"))139 Parameters.Add(new LookupParameter<StringArray>("LocationNames", "Optional: A list of names that describes the locations."));140 #endregion141 }142 143 132 public override IOperation Apply() { 144 133 var assignments = AssignmentParameter.ActualValue; … … 172 161 GQAPAssignment assignment = BestSolutionParameter.ActualValue; 173 162 if (assignment == null) { 174 assignment = new GQAPAssignment((IntegerVector)assignments[bestIndex].Clone(), (DoubleValue)qualities[bestIndex].Clone(), 175 equipmentNames, locationNames, distances, weights, installationCosts, demands, capacities, transportationCosts, 176 overbookedCapacityPenalty, flowDistanceQualities[bestIndex], installationQualities[bestIndex], overbookedCapacities[bestIndex]); 163 assignment = new GQAPAssignment((IntegerVector)assignments[bestIndex].Clone(), (DoubleValue)qualities[bestIndex].Clone(), flowDistanceQualities[bestIndex], overbookedCapacities[bestIndex], installationQualities[bestIndex], equipmentNames, locationNames, distances, weights, installationCosts, demands, capacities, transportationCosts, overbookedCapacityPenalty); 177 164 assignment.Distances = distances; 178 165 BestSolutionParameter.ActualValue = assignment; 179 166 results.Add(new Result("Best GQAP Solution", assignment)); 180 167 } else { 181 if (HasSolutionImproved(assignment.Quality.Value, qualities[bestIndex].Value, maximization)) { 182 assignment.Assignment = (IntegerVector)assignments[bestIndex].Clone(); 183 assignment.Quality = (DoubleValue)qualities[bestIndex].Clone(); 168 if (HasSolutionImproved(assignment.Solution.Quality.Value, qualities[bestIndex].Value, maximization)) { 169 assignment.Solution = new GQAPSolution((IntegerVector)assignments[bestIndex].Clone(), 170 (DoubleValue)qualities[bestIndex].Clone(), (DoubleValue)flowDistanceQualities[bestIndex].Clone(), 171 (DoubleValue)installationQualities[bestIndex].Clone(), (DoubleValue)overbookedCapacities[bestIndex].Clone()); 184 172 assignment.EquipmentNames = equipmentNames; 185 173 assignment.LocationNames = locationNames; … … 191 179 assignment.TransportationCosts = transportationCosts; 192 180 assignment.OverbookedCapacityPenalty = overbookedCapacityPenalty; 193 assignment.FlowDistanceQuality = (DoubleValue)flowDistanceQualities[bestIndex].Clone();194 assignment.InstallationQuality = (DoubleValue)installationQualities[bestIndex].Clone();195 assignment.OverbookedCapacity = (DoubleValue)overbookedCapacities[bestIndex].Clone();196 181 } 197 182 }
Note: See TracChangeset
for help on using the changeset viewer.