- Timestamp:
- 05/06/10 02:46:37 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3
- Files:
-
- 3 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/PopulationBestTSPSolutionAnalyzer.cs
r3659 r3662 36 36 [Item("PopulationBestTSPSolutionAnalyzer", "An operator for analyzing the best solution of Traveling Salesman Problems given in path representation using city coordinates.")] 37 37 [StorableClass] 38 public sealed class PopulationBestTSPSolutionAnalyzer : SingleSuccessorOperator, I BestTSPSolutionAnalyzer, IAnalyzer {39 public ILookupParameter<DoubleMatrix> CoordinatesParameter {40 get { return ( ILookupParameter<DoubleMatrix>)Parameters["Coordinates"]; }38 public sealed class PopulationBestTSPSolutionAnalyzer : SingleSuccessorOperator, IAnalyzer { 39 public LookupParameter<DoubleMatrix> CoordinatesParameter { 40 get { return (LookupParameter<DoubleMatrix>)Parameters["Coordinates"]; } 41 41 } 42 public ILookupParameter<ItemArray<Permutation>> PermutationParameter {43 get { return ( ILookupParameter<ItemArray<Permutation>>)Parameters["Permutation"]; }42 public ScopeTreeLookupParameter<Permutation> PermutationParameter { 43 get { return (ScopeTreeLookupParameter<Permutation>)Parameters["Permutation"]; } 44 44 } 45 ILookupParameter IBestTSPSolutionAnalyzer.PermutationParameter {46 get { return PermutationParameter; }45 public ScopeTreeLookupParameter<DoubleValue> QualityParameter { 46 get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; } 47 47 } 48 public ILookupParameter<ItemArray<DoubleValue>> QualityParameter {49 get { return ( ILookupParameter<ItemArray<DoubleValue>>)Parameters["Quality"]; }48 public LookupParameter<PathTSPTour> BestSolutionParameter { 49 get { return (LookupParameter<PathTSPTour>)Parameters["BestSolution"]; } 50 50 } 51 ILookupParameter IBestTSPSolutionAnalyzer.QualityParameter { 52 get { return QualityParameter; } 53 } 54 public ILookupParameter<PathTSPTour> BestSolutionParameter { 55 get { return (ILookupParameter<PathTSPTour>)Parameters["BestSolution"]; } 56 } 57 public IValueLookupParameter<ResultCollection> ResultsParameter { 58 get { return (IValueLookupParameter<ResultCollection>)Parameters["Results"]; } 51 public ValueLookupParameter<ResultCollection> ResultsParameter { 52 get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; } 59 53 } 60 54 -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/HeuristicLab.Problems.TravelingSalesman-3.3.csproj
r3635 r3662 84 84 </ItemGroup> 85 85 <ItemGroup> 86 <Compile Include="Analyzers\MultiPopulationBestTSPSolutionAnalyzer.cs" />87 86 <Compile Include="Analyzers\PopulationBestTSPSolutionAnalyzer.cs" /> 88 <Compile Include="Analyzers\BestTSPSolutionAnalyzer.cs" />89 87 <Compile Include="Evaluators\TSPEuclideanPathEvaluator.cs" /> 90 88 <Compile Include="Evaluators\TSPGeoPathEvaluator.cs" /> 91 89 <Compile Include="HeuristicLabProblemsTravelingSalesmanPlugin.cs" /> 92 <Compile Include="Interfaces\IBestTSPSolutionAnalyzer.cs" />93 90 <Compile Include="MoveEvaluators\ThreeOpt\TSPTranslocationMoveEuclideanPathEvaluator.cs" /> 94 91 <Compile Include="MoveEvaluators\ThreeOpt\TSPTranslocationMoveGeoPathEvaluator.cs" /> -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/TravelingSalesmanProblem.cs
r3635 r3662 124 124 get { return operators; } 125 125 } 126 private IEnumerable<IBestTSPSolutionAnalyzer> BestTSPSolutionAnalyzers{127 get { return operators.OfType< IBestTSPSolutionAnalyzer>(); }126 private PopulationBestTSPSolutionAnalyzer BestTSPSolutionAnalyzer { 127 get { return operators.OfType<PopulationBestTSPSolutionAnalyzer>().FirstOrDefault(); } 128 128 } 129 129 #endregion … … 231 231 ParameterizeSolutionCreator(); 232 232 ParameterizeEvaluator(); 233 ParameterizeAnalyzer s();233 ParameterizeAnalyzer(); 234 234 ParameterizeOperators(); 235 235 OnSolutionCreatorChanged(); … … 237 237 private void SolutionCreator_PermutationParameter_ActualNameChanged(object sender, EventArgs e) { 238 238 ParameterizeEvaluator(); 239 ParameterizeAnalyzer s();239 ParameterizeAnalyzer(); 240 240 ParameterizeOperators(); 241 241 } … … 244 244 ParameterizeEvaluator(); 245 245 UpdateMoveEvaluators(); 246 ParameterizeAnalyzer s();246 ParameterizeAnalyzer(); 247 247 ClearDistanceMatrix(); 248 248 OnEvaluatorChanged(); 249 249 } 250 250 private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) { 251 ParameterizeAnalyzer s();251 ParameterizeAnalyzer(); 252 252 } 253 253 private void MoveGenerator_InversionMoveParameter_ActualNameChanged(object sender, EventArgs e) { … … 280 280 private void InitializeOperators() { 281 281 operators = new List<IOperator>(); 282 operators.Add(new BestTSPSolutionAnalyzer());283 282 operators.Add(new PopulationBestTSPSolutionAnalyzer()); 284 operators.Add(new MultiPopulationBestTSPSolutionAnalyzer()); 285 ParameterizeAnalyzers(); 283 ParameterizeAnalyzer(); 286 284 operators.AddRange(ApplicationManager.Manager.GetInstances<IPermutationOperator>().Cast<IOperator>()); 287 285 ParameterizeOperators(); … … 325 323 } 326 324 } 327 private void ParameterizeAnalyzers() { 328 foreach (IBestTSPSolutionAnalyzer analyzer in BestTSPSolutionAnalyzers) { 329 analyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName; 330 analyzer.CoordinatesParameter.ActualName = CoordinatesParameter.Name; 331 analyzer.PermutationParameter.ActualName = SolutionCreator.PermutationParameter.ActualName; 332 analyzer.ResultsParameter.ActualName = "Results"; 333 } 325 private void ParameterizeAnalyzer() { 326 BestTSPSolutionAnalyzer.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName; 327 BestTSPSolutionAnalyzer.CoordinatesParameter.ActualName = CoordinatesParameter.Name; 328 BestTSPSolutionAnalyzer.PermutationParameter.ActualName = SolutionCreator.PermutationParameter.ActualName; 329 BestTSPSolutionAnalyzer.ResultsParameter.ActualName = "Results"; 334 330 } 335 331 private void ParameterizeOperators() {
Note: See TracChangeset
for help on using the changeset viewer.