Changeset 17446 for branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/BestTSPSolutionAnalyzer.cs
- Timestamp:
- 02/20/20 16:58:03 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/BestTSPSolutionAnalyzer.cs
r17180 r17446 56 56 get { return (LookupParameter<PathTSPTour>)Parameters["BestSolution"]; } 57 57 } 58 public ValueLookupParameter<ResultCollection> ResultsParameter {59 get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; }60 }58 //public ValueLookupParameter<ResultCollection> ResultsParameter { 59 // get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; } 60 //} 61 61 public LookupParameter<DoubleValue> BestKnownQualityParameter { 62 62 get { return (LookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; } … … 64 64 public LookupParameter<Permutation> BestKnownSolutionParameter { 65 65 get { return (LookupParameter<Permutation>)Parameters["BestKnownSolution"]; } 66 } 67 public IResultParameter<PathTSPTour> BestSolutionResultParameter { 68 get { return (IResultParameter<PathTSPTour>)Parameters["Best TSP Solution"]; } 69 } 70 71 72 [StorableHook(HookType.AfterDeserialization)] 73 private void AfterDeserialization() { 74 // BackwardsCompatibility3.3 75 #region Backwards compatible code, remove with 3.4 76 if (!Parameters.ContainsKey("Best TSP Solution")) { 77 Parameters.Add(new ResultParameter<PathTSPTour>("Best TSP Solution", "The best TSP solution found so far.")); 78 } 79 #endregion 66 80 } 67 81 … … 79 93 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The qualities of the TSP solutions which should be analyzed.")); 80 94 Parameters.Add(new LookupParameter<PathTSPTour>("BestSolution", "The best TSP solution.")); 81 Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best TSP solution should be stored."));95 //Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best TSP solution should be stored.")); 82 96 Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this TSP instance.")); 83 97 Parameters.Add(new LookupParameter<Permutation>("BestKnownSolution", "The best known solution of this TSP instance.")); 98 Parameters.Add(new ResultParameter<PathTSPTour>("Best TSP Solution", "The best TSP solution found so far.")); 84 99 85 100 MaximizationParameter.Hidden = true; … … 88 103 QualityParameter.Hidden = true; 89 104 BestSolutionParameter.Hidden = true; 90 ResultsParameter.Hidden = true;105 //ResultsParameter.Hidden = true; 91 106 BestKnownQualityParameter.Hidden = true; 92 107 BestKnownSolutionParameter.Hidden = true; … … 97 112 ItemArray<Permutation> permutations = PermutationParameter.ActualValue; 98 113 ItemArray<DoubleValue> qualities = QualityParameter.ActualValue; 99 ResultCollection results = ResultsParameter.ActualValue;114 //ResultCollection results = ResultsParameter.ActualValue; 100 115 bool max = MaximizationParameter.ActualValue.Value; 101 116 DoubleValue bestKnownQuality = BestKnownQualityParameter.ActualValue; … … 117 132 tour = new PathTSPTour(coordinates, (Permutation)permutations[i].Clone(), new DoubleValue(qualities[i].Value)); 118 133 BestSolutionParameter.ActualValue = tour; 119 results.Add(new Result("Best TSP Solution", tour)); 134 BestSolutionResultParameter.ActualValue = tour; 135 //results.Add(new Result("Best TSP Solution", tour)); 120 136 } else { 121 137 if (max && tour.Quality.Value < qualities[i].Value ||
Note: See TracChangeset
for help on using the changeset viewer.