Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/01/10 22:09:11 (14 years ago)
Author:
swinkler
Message:

Corrected storing of detail data for population diversity analysis, updated details view. (#1188)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.DiversityAnalysis/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/TSPPopulationDiversityAnalysisDetails.cs

    r4544 r4547  
    2424using HeuristicLab.Data;
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     26using HeuristicLab.Parameters;
    2627
    2728namespace HeuristicLab.Problems.TravelingSalesman {
     
    3233  [Item("TSPPopulationDiversityAnalysisDetails", "A class for storing details of population diversity analysis results.")]
    3334  [StorableClass]
    34   public class TSPPopulationDiversityAnalysisDetails : NamedItem {
     35  public class TSPPopulationDiversityAnalysisDetails : ParameterizedNamedItem {
    3536
    36     [Storable]
    37     private ItemList<DoubleValue> averageSimilarities;
     37    public static string AverageSimilaritiesKey = "AverageSimilarities";
     38    public ValueParameter<ItemList<DoubleValue>> AverageSimilaritiesParameter {
     39      get { return (ValueParameter<ItemList<DoubleValue>>)Parameters[AverageSimilaritiesKey]; }
     40    }
    3841    public ItemList<DoubleValue> AverageSimilarities {
    39       get { return averageSimilarities; }
    40     }
    41     [Storable]
    42     private ItemList<DoubleValue> averageMaximumSimilarities;
    43     public ItemList<DoubleValue> AverageMaximumSimilarities {
    44       get { return averageMaximumSimilarities; }
     42      get { return AverageSimilaritiesParameter.Value; }
    4543    }
    4644
    47     [Storable]
    48     private ItemList<DoubleMatrix> similarities;
     45    public static string AverageMaximumSimilaritiesKey = "AverageMaximumSimilarities";
     46    public ValueParameter<ItemList<DoubleValue>> AverageMaximumSimilaritiesParameter {
     47      get { return (ValueParameter<ItemList<DoubleValue>>)Parameters[AverageMaximumSimilaritiesKey]; }
     48    }
     49    public ItemList<DoubleValue> AverageMaximumSimilarities {
     50      get { return AverageMaximumSimilaritiesParameter.Value; }
     51    }
     52
     53    public static string SimilaritiesKey = "Similarities";
     54    public ValueParameter<ItemList<DoubleMatrix>> SimilaritiesParameter {
     55      get { return (ValueParameter<ItemList<DoubleMatrix>>)Parameters[SimilaritiesKey]; }
     56    }
    4957    public ItemList<DoubleMatrix> Similarities {
    50       get { return similarities; }
     58      get { return SimilaritiesParameter.Value; }
    5159    }
    52     [Storable]
    53     private ItemList<DoubleArray> maximumSimilarities;
     60
     61    public static string MaximumSimilaritiesKey = "MaximumSimilarities";
     62    public ValueParameter<ItemList<DoubleArray>> MaximumSimilaritiesParameter {
     63      get { return (ValueParameter<ItemList<DoubleArray>>)Parameters[MaximumSimilaritiesKey]; }
     64    }
    5465    public ItemList<DoubleArray> MaximumSimilarities {
    55       get { return maximumSimilarities; }
     66      get { return MaximumSimilaritiesParameter.Value; }
    5667    }
    5768
    5869    public TSPPopulationDiversityAnalysisDetails()
    5970        : base() {
    60       averageSimilarities = new ItemList<DoubleValue>();
    61       averageMaximumSimilarities = new ItemList<DoubleValue>();
    62       similarities = new ItemList<DoubleMatrix>();
    63       maximumSimilarities = new ItemList<DoubleArray>();
     71      Parameters.Add(new ValueParameter<ItemList<DoubleValue>>(AverageSimilaritiesKey, "Average similarities of the solutions of the population.", new ItemList<DoubleValue>()));
     72      Parameters.Add(new ValueParameter<ItemList<DoubleValue>>(AverageMaximumSimilaritiesKey, "Average maximum similarities of the solutions of the population.", new ItemList<DoubleValue>()));
     73      Parameters.Add(new ValueParameter<ItemList<DoubleMatrix>>(SimilaritiesKey, "Similarities of the solutions of the population.", new ItemList<DoubleMatrix>()));
     74      Parameters.Add(new ValueParameter<ItemList<DoubleArray>>(MaximumSimilaritiesKey, "Maximum similarities of the solutions of the population.", new ItemList<DoubleArray>()));
    6475    }
    6576
Note: See TracChangeset for help on using the changeset viewer.