Changeset 13794 for branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Common/3.3/Recommenders/FixedRankModel.cs
- Timestamp:
- 04/26/16 00:02:05 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Common/3.3/Recommenders/FixedRankModel.cs
r13791 r13794 21 21 22 22 using HeuristicLab.Optimization; 23 using System;24 23 using System.Collections.Generic; 25 24 26 25 namespace HeuristicLab.OptimizationExpertSystem.Common { 27 26 public class FixedRankModel : IRecommendationModel { 28 private readonly List< Tuple<IAlgorithm, double>> ranking;27 private readonly List<KeyValuePair<IAlgorithm, double>> ranking; 29 28 30 public FixedRankModel(IEnumerable< Tuple<IAlgorithm, double>> ranking) {31 this.ranking = new List< Tuple<IAlgorithm, double>>();29 public FixedRankModel(IEnumerable<KeyValuePair<IAlgorithm, double>> ranking) { 30 this.ranking = new List<KeyValuePair<IAlgorithm, double>>(); 32 31 foreach (var r in ranking) this.ranking.Add(r); 33 32 } 34 33 35 public IEnumerable< Tuple<IAlgorithm, double>> GetRanking(IRun problemInstance) {34 public IEnumerable<KeyValuePair<IAlgorithm, double>> GetRanking(IRun problemInstance) { 36 35 return ranking; 37 36 } 38 37 39 38 public static FixedRankModel GetEmpty() { 40 return new FixedRankModel(new Tuple<IAlgorithm, double>[0]);39 return new FixedRankModel(new KeyValuePair<IAlgorithm, double>[0]); 41 40 } 42 41 }
Note: See TracChangeset
for help on using the changeset viewer.