Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/27/14 11:23:37 (10 years ago)
Author:
jkarder
Message:

#2116: merged r10041-r11593 from trunk into branch

Location:
branches/Breadcrumbs
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/Breadcrumbs

  • branches/Breadcrumbs/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs

    r9592 r11594  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    133133      get { return (ValueParameter<IntValue>)Parameters["MaximumEvaluatedSolutions"]; }
    134134    }
     135    private IFixedValueParameter<BoolValue> FillPopulationWithParentsParameter {
     136      get { return (IFixedValueParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
     137    }
    135138    #endregion
    136139
     
    200203      set { ReevaluateElitesParameter.Value.Value = value; }
    201204    }
    202     private DoubleValue SuccessRatio {
     205    public DoubleValue SuccessRatio {
    203206      get { return SuccessRatioParameter.Value; }
    204207      set { SuccessRatioParameter.Value = value; }
    205208    }
    206     private DoubleValue ComparisonFactorLowerBound {
     209    public DoubleValue ComparisonFactorLowerBound {
    207210      get { return ComparisonFactorLowerBoundParameter.Value; }
    208211      set { ComparisonFactorLowerBoundParameter.Value = value; }
    209212    }
    210     private DoubleValue ComparisonFactorUpperBound {
     213    public DoubleValue ComparisonFactorUpperBound {
    211214      get { return ComparisonFactorUpperBoundParameter.Value; }
    212215      set { ComparisonFactorUpperBoundParameter.Value = value; }
     
    216219      set { ComparisonFactorModifierParameter.Value = value; }
    217220    }
    218     private DoubleValue MaximumSelectionPressure {
     221    public DoubleValue MaximumSelectionPressure {
    219222      get { return MaximumSelectionPressureParameter.Value; }
    220223      set { MaximumSelectionPressureParameter.Value = value; }
    221224    }
    222     private BoolValue OffspringSelectionBeforeMutation {
     225    public BoolValue OffspringSelectionBeforeMutation {
    223226      get { return OffspringSelectionBeforeMutationParameter.Value; }
    224227      set { OffspringSelectionBeforeMutationParameter.Value = value; }
     
    235238      get { return MaximumEvaluatedSolutionsParameter.Value; }
    236239      set { MaximumEvaluatedSolutionsParameter.Value = value; }
     240    }
     241    public bool FillPopulationWithParents {
     242      get { return FillPopulationWithParentsParameter.Value.Value; }
     243      set { FillPopulationWithParentsParameter.Value.Value = value; }
    237244    }
    238245    private RandomCreator RandomCreator {
     
    271278        Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", (BoolValue)new BoolValue(false).AsReadOnly()) { Hidden = true });
    272279      }
     280      if (!Parameters.ContainsKey("FillPopulationWithParents"))
     281        Parameters.Add(new FixedValueParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded.", new BoolValue(false)) { Hidden = true });
    273282      #endregion
    274283
     
    315324      Parameters.Add(new ValueParameter<MultiAnalyzer>("IslandAnalyzer", "The operator used to analyze each island.", new MultiAnalyzer()));
    316325      Parameters.Add(new ValueParameter<IntValue>("MaximumEvaluatedSolutions", "The maximum number of evaluated solutions (approximately).", new IntValue(int.MaxValue)));
     326      Parameters.Add(new FixedValueParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded.", new BoolValue(true)) { Hidden = true });
    317327
    318328      RandomCreator randomCreator = new RandomCreator();
     
    379389      mainLoop.OffspringSelectionBeforeMutationParameter.ActualName = OffspringSelectionBeforeMutationParameter.Name;
    380390      mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
     391      mainLoop.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
    381392      mainLoop.Successor = null;
    382393
  • branches/Breadcrumbs/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithmMainLoop.cs

    r9592 r11594  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    129129    public LookupParameter<IntValue> EvaluatedSolutionsParameter {
    130130      get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
     131    }
     132    public IValueLookupParameter<BoolValue> FillPopulationWithParentsParameter {
     133      get { return (IValueLookupParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
    131134    }
    132135    #endregion
     
    174177      Parameters.Add(new ValueLookupParameter<IOperator>("IslandAnalyzer", "The operator used to analyze each island."));
    175178      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated."));
     179      Parameters.Add(new ValueLookupParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded."));
    176180      #endregion
    177181
     
    265269      mainOperator.SelectorParameter.ActualName = SelectorParameter.Name;
    266270      mainOperator.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name;
     271      mainOperator.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
    267272
    268273      islandAnalyzer2.Name = "Island Analyzer (placeholder)";
     
    426431        Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    427432      }
     433      if (!Parameters.ContainsKey("FillPopulationWithParents"))
     434        Parameters.Add(new ValueLookupParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded."));
    428435      #endregion
    429436    }
  • branches/Breadcrumbs/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs

    r9592 r11594  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    112112      get { return (ValueParameter<IntValue>)Parameters["MaximumEvaluatedSolutions"]; }
    113113    }
     114    private IFixedValueParameter<BoolValue> FillPopulationWithParentsParameter {
     115      get { return (IFixedValueParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
     116    }
    114117    #endregion
    115118
     
    190193      get { return MaximumEvaluatedSolutionsParameter.Value; }
    191194      set { MaximumEvaluatedSolutionsParameter.Value = value; }
     195    }
     196    public bool FillPopulationWithParents {
     197      get { return FillPopulationWithParentsParameter.Value.Value; }
     198      set { FillPopulationWithParentsParameter.Value.Value = value; }
    192199    }
    193200    private RandomCreator RandomCreator {
     
    219226        Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", (BoolValue)new BoolValue(false).AsReadOnly()) { Hidden = true });
    220227      }
     228      if (!Parameters.ContainsKey("FillPopulationWithParents"))
     229        Parameters.Add(new FixedValueParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded.", new BoolValue(false)) { Hidden = true });
    221230      #endregion
    222231
     
    254263      Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer()));
    255264      Parameters.Add(new ValueParameter<IntValue>("MaximumEvaluatedSolutions", "The maximum number of evaluated solutions (approximately).", new IntValue(int.MaxValue)));
     265      Parameters.Add(new FixedValueParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded.", new BoolValue(false)) { Hidden = true });
    256266
    257267      RandomCreator randomCreator = new RandomCreator();
     
    297307      mainLoop.SelectorParameter.ActualName = SelectorParameter.Name;
    298308      mainLoop.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name;
     309      mainLoop.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
    299310
    300311      foreach (ISelector selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is IMultiObjectiveSelector)).OrderBy(x => x.Name))
  • branches/Breadcrumbs/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs

    r9592 r11594  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    9696      get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
    9797    }
     98    public IValueLookupParameter<BoolValue> FillPopulationWithParentsParameter {
     99      get { return (IValueLookupParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
     100    }
    98101    #endregion
    99102
     
    118121        Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    119122      }
     123      if (!Parameters.ContainsKey("FillPopulationWithParents"))
     124        Parameters.Add(new ValueLookupParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded."));
    120125      #endregion
    121126    }
     
    144149      Parameters.Add(new ValueLookupParameter<BoolValue>("OffspringSelectionBeforeMutation", "True if the offspring selection step should be applied before mutation, false if it should be applied after mutation."));
    145150      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated."));
     151      Parameters.Add(new ValueLookupParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded."));
    146152      #endregion
    147153
     
    197203      mainOperator.SelectorParameter.ActualName = SelectorParameter.Name;
    198204      mainOperator.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name;
     205      mainOperator.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
    199206
    200207      generationsCounter.Increment = new IntValue(1);
  • branches/Breadcrumbs/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainOperator.cs

    r9592 r11594  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    8888      get { return (ValueLookupParameter<BoolValue>)Parameters["OffspringSelectionBeforeMutation"]; }
    8989    }
     90    public IValueLookupParameter<BoolValue> FillPopulationWithParentsParameter {
     91      get { return (IValueLookupParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
     92    }
    9093    #endregion
    9194
     
    110113        Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    111114      }
     115      if (!Parameters.ContainsKey("FillPopulationWithParents"))
     116        Parameters.Add(new ValueLookupParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded."));
    112117      #endregion
    113118    }
     
    132137      Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumSelectionPressure", "The maximum selection pressure that terminates the algorithm."));
    133138      Parameters.Add(new ValueLookupParameter<BoolValue>("OffspringSelectionBeforeMutation", "True if the offspring selection step should be applied before mutation, false if it should be applied after mutation."));
     139      Parameters.Add(new ValueLookupParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded."));
    134140      #endregion
    135141
     
    261267      offspringSelector.OffspringPopulationWinnersParameter.ActualName = "OffspringPopulationWinners";
    262268      offspringSelector.SuccessfulOffspringParameter.ActualName = "SuccessfulOffspring";
     269      offspringSelector.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
    263270
    264271      bestSelector.CopySelected = new BoolValue(false);
  • branches/Breadcrumbs/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/Plugin.cs.frame

    r10037 r11594  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2626  /// Plugin class for HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm plugin.
    2727  /// </summary>
    28   [Plugin("HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm", "3.3.9.$WCREV$")]
     28  [Plugin("HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm", "3.3.10.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Analysis", "3.3")]
  • branches/Breadcrumbs/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/Properties/AssemblyInfo.cs.frame

    r10037 r11594  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3131[assembly: AssemblyCompany("")]
    3232[assembly: AssemblyProduct("HeuristicLab")]
    33 [assembly: AssemblyCopyright("(c) 2002-2013 HEAL")]
     33[assembly: AssemblyCopyright("(c) 2002-2014 HEAL")]
    3434[assembly: AssemblyTrademark("")]
    3535[assembly: AssemblyCulture("")]
     
    5353// by using the '*' as shown below:
    5454[assembly: AssemblyVersion("3.3.0.0")]
    55 [assembly: AssemblyFileVersion("3.3.9.$WCREV$")]
     55[assembly: AssemblyFileVersion("3.3.10.$WCREV$")]
  • branches/Breadcrumbs/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASA.cs

    r9592 r11594  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    121121      get { return (ValueParameter<IntValue>)Parameters["MaximumEvaluatedSolutions"]; }
    122122    }
     123    private IFixedValueParameter<BoolValue> FillPopulationWithParentsParameter {
     124      get { return (IFixedValueParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
     125    }
    123126    #endregion
    124127
     
    211214      get { return MaximumEvaluatedSolutionsParameter.Value; }
    212215      set { MaximumEvaluatedSolutionsParameter.Value = value; }
     216    }
     217    public bool FillPopulationWithParents {
     218      get { return FillPopulationWithParentsParameter.Value.Value; }
     219      set { FillPopulationWithParentsParameter.Value.Value = value; }
    213220    }
    214221    private RandomCreator RandomCreator {
     
    247254        Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", (BoolValue)new BoolValue(false).AsReadOnly()) { Hidden = true });
    248255      }
     256      if (!Parameters.ContainsKey("FillPopulationWithParents"))
     257        Parameters.Add(new FixedValueParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded.", new BoolValue(false)) { Hidden = true });
    249258      #endregion
    250259
     
    287296      Parameters.Add(new ValueParameter<MultiAnalyzer>("VillageAnalyzer", "The operator used to analyze each village.", new MultiAnalyzer()));
    288297      Parameters.Add(new ValueParameter<IntValue>("MaximumEvaluatedSolutions", "The maximum number of evaluated solutions (approximately).", new IntValue(int.MaxValue)));
     298      Parameters.Add(new FixedValueParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded.", new BoolValue(true)) { Hidden = true });
    289299
    290300      RandomCreator randomCreator = new RandomCreator();
     
    346356      mainLoop.OffspringSelectionBeforeMutationParameter.ActualName = OffspringSelectionBeforeMutationParameter.Name;
    347357      mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
     358      mainLoop.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
    348359      mainLoop.Successor = null;
    349360
  • branches/Breadcrumbs/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASAMainLoop.cs

    r9592 r11594  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    111111    public LookupParameter<IntValue> EvaluatedSolutionsParameter {
    112112      get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
     113    }
     114    public IValueLookupParameter<BoolValue> FillPopulationWithParentsParameter {
     115      get { return (IValueLookupParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
    113116    }
    114117    #endregion
     
    150153      Parameters.Add(new ValueLookupParameter<BoolValue>("OffspringSelectionBeforeMutation", "True if the offspring selection step should be applied before mutation, false if it should be applied after mutation."));
    151154      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated."));
     155      Parameters.Add(new ValueLookupParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded."));
    152156      #endregion
    153157
     
    253257      mainOperator.SelectorParameter.ActualName = SelectorParameter.Name;
    254258      mainOperator.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name;
     259      mainOperator.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
    255260
    256261      villageAnalyzer2.Name = "Village Analyzer (placeholder)";
     
    436441        Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    437442      }
     443      if (!Parameters.ContainsKey("FillPopulationWithParents"))
     444        Parameters.Add(new ValueLookupParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded."));
    438445      #endregion
    439446    }
  • branches/Breadcrumbs/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SuccessfulOffspringAnalysis/SuccessfulOffspringAnalyzer.cs

    r9456 r11594  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    8181      Parameters.Add(new LookupParameter<ResultCollection>("SuccessfulOffspringAnalysis", "The successful offspring analysis which is created."));
    8282      Parameters.Add(new ValueParameter<IntValue>("Depth", "The depth of the individuals in the scope tree.", new IntValue(1)));
     83
     84      CollectedValuesParameter.Value.Add(new StringValue("SelectedCrossoverOperator"));
     85      CollectedValuesParameter.Value.Add(new StringValue("SelectedManipulationOperator"));
    8386    }
    8487
     
    110113        }
    111114
    112         //create a data table containing the collected values
    113         ResultCollection successfulOffspringAnalysis;
     115        if (counts.Count > 0) {
     116          //create a data table containing the collected values
     117          ResultCollection successfulOffspringAnalysis;
    114118
    115         if (SuccessfulOffspringAnalysisParameter.ActualValue == null) {
    116           successfulOffspringAnalysis = new ResultCollection();
    117           SuccessfulOffspringAnalysisParameter.ActualValue = successfulOffspringAnalysis;
    118         } else {
    119           successfulOffspringAnalysis = SuccessfulOffspringAnalysisParameter.ActualValue;
    120         }
    121 
    122         string resultKey = "SuccessfulOffspringAnalyzer Results";
    123         if (!results.ContainsKey(resultKey)) {
    124           results.Add(new Result(resultKey, successfulOffspringAnalysis));
    125         } else {
    126           results[resultKey].Value = successfulOffspringAnalysis;
    127         }
    128 
    129         DataTable successProgressAnalysis;
    130         if (!successfulOffspringAnalysis.ContainsKey(collected.Value)) {
    131           successProgressAnalysis = new DataTable();
    132           successProgressAnalysis.Name = collected.Value;
    133           successfulOffspringAnalysis.Add(new Result(collected.Value, successProgressAnalysis));
    134         } else {
    135           successProgressAnalysis = successfulOffspringAnalysis[collected.Value].Value as DataTable;
    136         }
    137 
    138         int successfulCount = 0;
    139         foreach (string key in counts.Keys) {
    140           successfulCount += counts[key];
    141         }
    142 
    143         foreach (String value in counts.Keys) {
    144           DataRow row;
    145           if (!successProgressAnalysis.Rows.ContainsKey(value)) {
    146             row = new DataRow(value);
    147             int iterations = GenerationsParameter.ActualValue.Value;
    148 
    149             //fill up all values seen the first time
    150             for (int i = 1; i < iterations; i++)
    151               row.Values.Add(0);
    152 
    153             successProgressAnalysis.Rows.Add(row);
     119          if (SuccessfulOffspringAnalysisParameter.ActualValue == null) {
     120            successfulOffspringAnalysis = new ResultCollection();
     121            SuccessfulOffspringAnalysisParameter.ActualValue = successfulOffspringAnalysis;
    154122          } else {
    155             row = successProgressAnalysis.Rows[value];
     123            successfulOffspringAnalysis = SuccessfulOffspringAnalysisParameter.ActualValue;
    156124          }
    157125
    158           row.Values.Add(counts[value] / (double)successfulCount);
    159         }
     126          string resultKey = "SuccessfulOffspringAnalyzer Results";
     127          if (!results.ContainsKey(resultKey)) {
     128            results.Add(new Result(resultKey, successfulOffspringAnalysis));
     129          } else {
     130            results[resultKey].Value = successfulOffspringAnalysis;
     131          }
    160132
    161         //fill up all values that are not present in the current generation
    162         foreach (DataRow row in successProgressAnalysis.Rows) {
    163           if (!counts.ContainsKey(row.Name))
    164             row.Values.Add(0);
     133          DataTable successProgressAnalysis;
     134          if (!successfulOffspringAnalysis.ContainsKey(collected.Value)) {
     135            successProgressAnalysis = new DataTable();
     136            successProgressAnalysis.Name = collected.Value;
     137            successfulOffspringAnalysis.Add(new Result(collected.Value, successProgressAnalysis));
     138          } else {
     139            successProgressAnalysis = successfulOffspringAnalysis[collected.Value].Value as DataTable;
     140          }
     141
     142          int successfulCount = 0;
     143          foreach (string key in counts.Keys) {
     144            successfulCount += counts[key];
     145          }
     146
     147          foreach (String value in counts.Keys) {
     148            DataRow row;
     149            if (!successProgressAnalysis.Rows.ContainsKey(value)) {
     150              row = new DataRow(value);
     151              int iterations = GenerationsParameter.ActualValue.Value;
     152
     153              //fill up all values seen the first time
     154              for (int i = 1; i < iterations; i++)
     155                row.Values.Add(0);
     156
     157              successProgressAnalysis.Rows.Add(row);
     158            } else {
     159              row = successProgressAnalysis.Rows[value];
     160            }
     161
     162            row.Values.Add(counts[value] / (double)successfulCount);
     163          }
     164
     165          //fill up all values that are not present in the current generation
     166          foreach (DataRow row in successProgressAnalysis.Rows) {
     167            if (!counts.ContainsKey(row.Name))
     168              row.Values.Add(0);
     169          }
    165170        }
    166171      }
Note: See TracChangeset for help on using the changeset viewer.