Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/18/14 12:35:00 (10 years ago)
Author:
ascheibe
Message:

reverted last commit

Location:
branches/HiveStatistics/sources
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources

  • branches/HiveStatistics/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    100100      get { return (ValueParameter<IntValue>)Parameters["Elites"]; }
    101101    }
    102     private IFixedValueParameter<BoolValue> ReevaluateElitesParameter {
    103       get { return (IFixedValueParameter<BoolValue>)Parameters["ReevaluateElites"]; }
    104     }
    105102    private ValueLookupParameter<DoubleValue> SuccessRatioParameter {
    106103      get { return (ValueLookupParameter<DoubleValue>)Parameters["SuccessRatio"]; }
     
    132129    private ValueParameter<IntValue> MaximumEvaluatedSolutionsParameter {
    133130      get { return (ValueParameter<IntValue>)Parameters["MaximumEvaluatedSolutions"]; }
    134     }
    135     private IFixedValueParameter<BoolValue> FillPopulationWithParentsParameter {
    136       get { return (IFixedValueParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
    137131    }
    138132    #endregion
     
    199193      set { ElitesParameter.Value = value; }
    200194    }
    201     public bool ReevaluteElites {
    202       get { return ReevaluateElitesParameter.Value.Value; }
    203       set { ReevaluateElitesParameter.Value.Value = value; }
    204     }
    205     public DoubleValue SuccessRatio {
     195    private DoubleValue SuccessRatio {
    206196      get { return SuccessRatioParameter.Value; }
    207197      set { SuccessRatioParameter.Value = value; }
    208198    }
    209     public DoubleValue ComparisonFactorLowerBound {
     199    private DoubleValue ComparisonFactorLowerBound {
    210200      get { return ComparisonFactorLowerBoundParameter.Value; }
    211201      set { ComparisonFactorLowerBoundParameter.Value = value; }
    212202    }
    213     public DoubleValue ComparisonFactorUpperBound {
     203    private DoubleValue ComparisonFactorUpperBound {
    214204      get { return ComparisonFactorUpperBoundParameter.Value; }
    215205      set { ComparisonFactorUpperBoundParameter.Value = value; }
     
    219209      set { ComparisonFactorModifierParameter.Value = value; }
    220210    }
    221     public DoubleValue MaximumSelectionPressure {
     211    private DoubleValue MaximumSelectionPressure {
    222212      get { return MaximumSelectionPressureParameter.Value; }
    223213      set { MaximumSelectionPressureParameter.Value = value; }
    224214    }
    225     public BoolValue OffspringSelectionBeforeMutation {
     215    private BoolValue OffspringSelectionBeforeMutation {
    226216      get { return OffspringSelectionBeforeMutationParameter.Value; }
    227217      set { OffspringSelectionBeforeMutationParameter.Value = value; }
     
    238228      get { return MaximumEvaluatedSolutionsParameter.Value; }
    239229      set { MaximumEvaluatedSolutionsParameter.Value = value; }
    240     }
    241     public bool FillPopulationWithParents {
    242       get { return FillPopulationWithParentsParameter.Value.Value; }
    243       set { FillPopulationWithParentsParameter.Value.Value = value; }
    244230    }
    245231    private RandomCreator RandomCreator {
     
    271257    [StorableHook(HookType.AfterDeserialization)]
    272258    private void AfterDeserialization() {
    273       // BackwardsCompatibility3.3
    274       #region Backwards compatible code, remove with 3.4
     259      #region Backwards Compatibility
    275260      if (successfulOffspringAnalyzer == null)
    276261        successfulOffspringAnalyzer = new SuccessfulOffspringAnalyzer();
    277       if (!Parameters.ContainsKey("ReevaluateElites")) {
    278         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 });
    279       }
    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 });
    282262      #endregion
    283263
     
    313293      Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
    314294      Parameters.Add(new ValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1)));
    315       Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", new BoolValue(false)) { Hidden = true });
    316295      Parameters.Add(new ValueLookupParameter<DoubleValue>("SuccessRatio", "The ratio of successful to total children that should be achieved.", new DoubleValue(1)));
    317296      Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorLowerBound", "The lower bound of the comparison factor (start).", new DoubleValue(0)));
     
    324303      Parameters.Add(new ValueParameter<MultiAnalyzer>("IslandAnalyzer", "The operator used to analyze each island.", new MultiAnalyzer()));
    325304      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 });
    327305
    328306      RandomCreator randomCreator = new RandomCreator();
     
    377355      mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name;
    378356      mainLoop.ElitesParameter.ActualName = ElitesParameter.Name;
    379       mainLoop.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name;
    380357      mainLoop.MutatorParameter.ActualName = MutatorParameter.Name;
    381358      mainLoop.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
     
    389366      mainLoop.OffspringSelectionBeforeMutationParameter.ActualName = OffspringSelectionBeforeMutationParameter.Name;
    390367      mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
    391       mainLoop.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
    392368      mainLoop.Successor = null;
    393369
  • branches/HiveStatistics/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithmMainLoop.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    9191      get { return (ValueLookupParameter<IntValue>)Parameters["Elites"]; }
    9292    }
    93     public IValueLookupParameter<BoolValue> ReevaluateElitesParameter {
    94       get { return (IValueLookupParameter<BoolValue>)Parameters["ReevaluateElites"]; }
    95     }
    9693    public ValueLookupParameter<ResultCollection> ResultsParameter {
    9794      get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; }
     
    129126    public LookupParameter<IntValue> EvaluatedSolutionsParameter {
    130127      get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
    131     }
    132     public IValueLookupParameter<BoolValue> FillPopulationWithParentsParameter {
    133       get { return (IValueLookupParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
    134128    }
    135129    #endregion
     
    164158      Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions. This operator is executed in parallel, if an engine is used which supports parallelization."));
    165159      Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation."));
    166       Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    167160      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The results collection to store the results."));
    168161      Parameters.Add(new ValueLookupParameter<IOperator>("Visualizer", "The operator used to visualize solutions."));
     
    177170      Parameters.Add(new ValueLookupParameter<IOperator>("IslandAnalyzer", "The operator used to analyze each island."));
    178171      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."));
    180172      #endregion
    181173
     
    256248      mainOperator.CurrentSuccessRatioParameter.ActualName = "CurrentSuccessRatio";
    257249      mainOperator.ElitesParameter.ActualName = ElitesParameter.Name;
    258       mainOperator.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name;
    259250      mainOperator.EvaluatedSolutionsParameter.ActualName = EvaluatedSolutionsParameter.Name;
    260251      mainOperator.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
     
    269260      mainOperator.SelectorParameter.ActualName = SelectorParameter.Name;
    270261      mainOperator.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name;
    271       mainOperator.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
    272262
    273263      islandAnalyzer2.Name = "Island Analyzer (placeholder)";
     
    424414    }
    425415
    426     [StorableHook(HookType.AfterDeserialization)]
    427     private void AfterDeserialization() {
    428       // BackwardsCompatibility3.3
    429       #region Backwards compatible code, remove with 3.4
    430       if (!Parameters.ContainsKey("ReevaluateElites")) {
    431         Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    432       }
    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."));
    435       #endregion
    436     }
    437 
    438416    public override IOperation Apply() {
    439417      if (CrossoverParameter.ActualValue == null)
  • branches/HiveStatistics/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    7979      get { return (ValueParameter<IntValue>)Parameters["Elites"]; }
    8080    }
    81     private IFixedValueParameter<BoolValue> ReevaluateElitesParameter {
    82       get { return (IFixedValueParameter<BoolValue>)Parameters["ReevaluateElites"]; }
    83     }
    8481    private ValueParameter<IntValue> MaximumGenerationsParameter {
    8582      get { return (ValueParameter<IntValue>)Parameters["MaximumGenerations"]; }
     
    111108    private ValueParameter<IntValue> MaximumEvaluatedSolutionsParameter {
    112109      get { return (ValueParameter<IntValue>)Parameters["MaximumEvaluatedSolutions"]; }
    113     }
    114     private IFixedValueParameter<BoolValue> FillPopulationWithParentsParameter {
    115       get { return (IFixedValueParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
    116110    }
    117111    #endregion
     
    150144      set { ElitesParameter.Value = value; }
    151145    }
    152     public bool ReevaluteElites {
    153       get { return ReevaluateElitesParameter.Value.Value; }
    154       set { ReevaluateElitesParameter.Value.Value = value; }
    155     }
    156146    public IntValue MaximumGenerations {
    157147      get { return MaximumGenerationsParameter.Value; }
     
    193183      get { return MaximumEvaluatedSolutionsParameter.Value; }
    194184      set { MaximumEvaluatedSolutionsParameter.Value = value; }
    195     }
    196     public bool FillPopulationWithParents {
    197       get { return FillPopulationWithParentsParameter.Value.Value; }
    198       set { FillPopulationWithParentsParameter.Value.Value = value; }
    199185    }
    200186    private RandomCreator RandomCreator {
     
    219205    [StorableHook(HookType.AfterDeserialization)]
    220206    private void AfterDeserialization() {
    221       // BackwardsCompatibility3.3
    222       #region Backwards compatible code, remove with 3.4
     207      #region Backwards Compatibility
    223208      if (successfulOffspringAnalyzer == null)
    224209        successfulOffspringAnalyzer = new SuccessfulOffspringAnalyzer();
    225       if (!Parameters.ContainsKey("ReevaluateElites")) {
    226         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 });
    227       }
    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 });
    230210      #endregion
    231211
     
    252232      Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
    253233      Parameters.Add(new ValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1)));
    254       Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", new BoolValue(false)) { Hidden = true });
    255234      Parameters.Add(new ValueParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.", new IntValue(1000)));
    256235      Parameters.Add(new ValueLookupParameter<DoubleValue>("SuccessRatio", "The ratio of successful to total children that should be achieved.", new DoubleValue(1)));
     
    263242      Parameters.Add(new ValueParameter<MultiAnalyzer>("Analyzer", "The operator used to analyze each generation.", new MultiAnalyzer()));
    264243      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 });
    266244
    267245      RandomCreator randomCreator = new RandomCreator();
     
    296274      mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name;
    297275      mainLoop.ElitesParameter.ActualName = ElitesParameter.Name;
    298       mainLoop.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name;
    299276      mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
    300277      mainLoop.MaximumGenerationsParameter.ActualName = MaximumGenerationsParameter.Name;
     
    307284      mainLoop.SelectorParameter.ActualName = SelectorParameter.Name;
    308285      mainLoop.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name;
    309       mainLoop.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
    310286
    311287      foreach (ISelector selector in ApplicationManager.Manager.GetInstances<ISelector>().Where(x => !(x is IMultiObjectiveSelector)).OrderBy(x => x.Name))
  • branches/HiveStatistics/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    6363      get { return (ValueLookupParameter<IntValue>)Parameters["Elites"]; }
    6464    }
    65     public IValueLookupParameter<BoolValue> ReevaluateElitesParameter {
    66       get { return (IValueLookupParameter<BoolValue>)Parameters["ReevaluateElites"]; }
    67     }
    6865    public ValueLookupParameter<IntValue> MaximumGenerationsParameter {
    6966      get { return (ValueLookupParameter<IntValue>)Parameters["MaximumGenerations"]; }
     
    9592    public LookupParameter<IntValue> EvaluatedSolutionsParameter {
    9693      get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
    97     }
    98     public IValueLookupParameter<BoolValue> FillPopulationWithParentsParameter {
    99       get { return (IValueLookupParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
    10094    }
    10195    #endregion
     
    112106      : base() {
    113107      Initialize();
    114     }
    115 
    116     [StorableHook(HookType.AfterDeserialization)]
    117     private void AfterDeserialization() {
    118       // BackwardsCompatibility3.3
    119       #region Backwards compatible code, remove with 3.4
    120       if (!Parameters.ContainsKey("ReevaluateElites")) {
    121         Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    122       }
    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."));
    125       #endregion
    126108    }
    127109
     
    138120      Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions. This operator is executed in parallel, if an engine is used which supports parallelization."));
    139121      Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation."));
    140       Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    141122      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed."));
    142123      Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored."));
     
    149130      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."));
    150131      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."));
    152132      #endregion
    153133
     
    190170      mainOperator.CurrentSuccessRatioParameter.ActualName = "CurrentSuccessRatio";
    191171      mainOperator.ElitesParameter.ActualName = ElitesParameter.Name;
    192       mainOperator.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name;
    193172      mainOperator.EvaluatedSolutionsParameter.ActualName = EvaluatedSolutionsParameter.Name;
    194173      mainOperator.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
     
    203182      mainOperator.SelectorParameter.ActualName = SelectorParameter.Name;
    204183      mainOperator.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name;
    205       mainOperator.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
    206184
    207185      generationsCounter.Increment = new IntValue(1);
  • branches/HiveStatistics/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainOperator.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    6767      get { return (ValueLookupParameter<IntValue>)Parameters["Elites"]; }
    6868    }
    69     public IValueLookupParameter<BoolValue> ReevaluateElitesParameter {
    70       get { return (IValueLookupParameter<BoolValue>)Parameters["ReevaluateElites"]; }
    71     }
    7269    public LookupParameter<DoubleValue> ComparisonFactorParameter {
    7370      get { return (LookupParameter<DoubleValue>)Parameters["ComparisonFactor"]; }
     
    8784    public ValueLookupParameter<BoolValue> OffspringSelectionBeforeMutationParameter {
    8885      get { return (ValueLookupParameter<BoolValue>)Parameters["OffspringSelectionBeforeMutation"]; }
    89     }
    90     public IValueLookupParameter<BoolValue> FillPopulationWithParentsParameter {
    91       get { return (IValueLookupParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
    9286    }
    9387    #endregion
     
    10498      : base() {
    10599      Initialize();
    106     }
    107 
    108     [StorableHook(HookType.AfterDeserialization)]
    109     private void AfterDeserialization() {
    110       // BackwardsCompatibility3.3
    111       #region Backwards compatible code, remove with 3.4
    112       if (!Parameters.ContainsKey("ReevaluateElites")) {
    113         Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    114       }
    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."));
    117       #endregion
    118100    }
    119101
     
    130112      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of evaluated solutions."));
    131113      Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation."));
    132       Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    133114      Parameters.Add(new LookupParameter<DoubleValue>("ComparisonFactor", "The comparison factor is used to determine whether the offspring should be compared to the better parent, the worse parent or a quality value linearly interpolated between them. It is in the range [0;1]."));
    134115      Parameters.Add(new LookupParameter<DoubleValue>("CurrentSuccessRatio", "The current success ratio."));
     
    137118      Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumSelectionPressure", "The maximum selection pressure that terminates the algorithm."));
    138119      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."));
    140120      #endregion
    141121
     
    179159      LeftReducer leftReducer = new LeftReducer();
    180160      MergingReducer mergingReducer2 = new MergingReducer();
    181       ConditionalBranch reevaluateElitesBranch = new ConditionalBranch();
    182       UniformSubScopesProcessor uniformSubScopesProcessor7 = new UniformSubScopesProcessor();
    183       Placeholder evaluator4 = new Placeholder();
    184       SubScopesCounter subScopesCounter4 = new SubScopesCounter();
    185161
    186162      selector.Name = "Selector (placeholder)";
     
    267243      offspringSelector.OffspringPopulationWinnersParameter.ActualName = "OffspringPopulationWinners";
    268244      offspringSelector.SuccessfulOffspringParameter.ActualName = "SuccessfulOffspring";
    269       offspringSelector.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
    270245
    271246      bestSelector.CopySelected = new BoolValue(false);
     
    278253      worstSelector.NumberOfSelectedSubScopesParameter.ActualName = ElitesParameter.Name;
    279254      worstSelector.QualityParameter.ActualName = QualityParameter.Name;
    280 
    281       reevaluateElitesBranch.ConditionParameter.ActualName = "ReevaluateElites";
    282       reevaluateElitesBranch.Name = "Reevaluate elites ?";
    283 
    284       uniformSubScopesProcessor7.Parallel.Value = true;
    285 
    286       evaluator4.Name = "Evaluator (placeholder)";
    287       evaluator4.OperatorParameter.ActualName = EvaluatorParameter.Name;
    288 
    289       subScopesCounter4.Name = "Increment EvaluatedSolutions";
    290       subScopesCounter4.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
    291255      #endregion
    292256
     
    346310      subScopesProcessor3.Successor = mergingReducer2;
    347311      bestSelector.Successor = rightReducer;
    348       rightReducer.Successor = reevaluateElitesBranch;
    349       reevaluateElitesBranch.TrueBranch = uniformSubScopesProcessor7;
    350       uniformSubScopesProcessor7.Operator = evaluator4;
    351       uniformSubScopesProcessor7.Successor = subScopesCounter4;
    352       subScopesCounter4.Successor = null;
    353       reevaluateElitesBranch.FalseBranch = null;
    354       reevaluateElitesBranch.Successor = null;
     312      rightReducer.Successor = null;
    355313      worstSelector.Successor = leftReducer;
    356314      leftReducer.Successor = null;
  • branches/HiveStatistics/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/Plugin.cs.frame

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 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.10.$WCREV$")]
     28  [Plugin("HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm", "3.3.7.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Analysis", "3.3")]
  • branches/HiveStatistics/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/Properties/AssemblyInfo.cs.frame

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 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-2014 HEAL")]
     33[assembly: AssemblyCopyright("(c) 2002-2012 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.10.$WCREV$")]
     55[assembly: AssemblyFileVersion("3.3.7.$WCREV$")]
  • branches/HiveStatistics/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASA.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    8585      get { return (ValueParameter<IntValue>)Parameters["Elites"]; }
    8686    }
    87     private IFixedValueParameter<BoolValue> ReevaluateElitesParameter {
    88       get { return (IFixedValueParameter<BoolValue>)Parameters["ReevaluateElites"]; }
    89     }
    9087    private ValueLookupParameter<DoubleValue> SuccessRatioParameter {
    9188      get { return (ValueLookupParameter<DoubleValue>)Parameters["SuccessRatio"]; }
     
    120117    private ValueParameter<IntValue> MaximumEvaluatedSolutionsParameter {
    121118      get { return (ValueParameter<IntValue>)Parameters["MaximumEvaluatedSolutions"]; }
    122     }
    123     private IFixedValueParameter<BoolValue> FillPopulationWithParentsParameter {
    124       get { return (IFixedValueParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
    125119    }
    126120    #endregion
     
    167161      set { ElitesParameter.Value = value; }
    168162    }
    169     public bool ReevaluteElites {
    170       get { return ReevaluateElitesParameter.Value.Value; }
    171       set { ReevaluateElitesParameter.Value.Value = value; }
    172     }
    173163    public DoubleValue SuccessRatio {
    174164      get { return SuccessRatioParameter.Value; }
     
    214204      get { return MaximumEvaluatedSolutionsParameter.Value; }
    215205      set { MaximumEvaluatedSolutionsParameter.Value = value; }
    216     }
    217     public bool FillPopulationWithParents {
    218       get { return FillPopulationWithParentsParameter.Value.Value; }
    219       set { FillPopulationWithParentsParameter.Value.Value = value; }
    220206    }
    221207    private RandomCreator RandomCreator {
     
    247233    [StorableHook(HookType.AfterDeserialization)]
    248234    private void AfterDeserialization() {
    249       // BackwardsCompatibility3.3
    250       #region Backwards compatible code, remove with 3.4
     235      #region Backwards Compatibility
    251236      if (successfulOffspringAnalyzer == null)
    252237        successfulOffspringAnalyzer = new SuccessfulOffspringAnalyzer();
    253       if (!Parameters.ContainsKey("ReevaluateElites")) {
    254         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 });
    255       }
    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 });
    258238      #endregion
    259239
     
    284264      Parameters.Add(new OptionalConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions."));
    285265      Parameters.Add(new ValueParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation.", new IntValue(1)));
    286       Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)", new BoolValue(false)) { Hidden = true });
    287266      Parameters.Add(new ValueLookupParameter<DoubleValue>("SuccessRatio", "The ratio of successful to total children that should be achieved.", new DoubleValue(1)));
    288267      Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorLowerBound", "The lower bound of the comparison factor (start).", new DoubleValue(0.3)));
     
    296275      Parameters.Add(new ValueParameter<MultiAnalyzer>("VillageAnalyzer", "The operator used to analyze each village.", new MultiAnalyzer()));
    297276      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 });
    299277
    300278      RandomCreator randomCreator = new RandomCreator();
     
    343321      mainLoop.CrossoverParameter.ActualName = CrossoverParameter.Name;
    344322      mainLoop.ElitesParameter.ActualName = ElitesParameter.Name;
    345       mainLoop.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name;
    346323      mainLoop.MutatorParameter.ActualName = MutatorParameter.Name;
    347324      mainLoop.MutationProbabilityParameter.ActualName = MutationProbabilityParameter.Name;
     
    356333      mainLoop.OffspringSelectionBeforeMutationParameter.ActualName = OffspringSelectionBeforeMutationParameter.Name;
    357334      mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
    358       mainLoop.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
    359335      mainLoop.Successor = null;
    360336
  • branches/HiveStatistics/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASAMainLoop.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    7373      get { return (ValueLookupParameter<IntValue>)Parameters["Elites"]; }
    7474    }
    75     public IValueLookupParameter<BoolValue> ReevaluateElitesParameter {
    76       get { return (IValueLookupParameter<BoolValue>)Parameters["ReevaluateElites"]; }
    77     }
    7875    public ValueLookupParameter<ResultCollection> ResultsParameter {
    7976      get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; }
     
    111108    public LookupParameter<IntValue> EvaluatedSolutionsParameter {
    112109      get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
    113     }
    114     public IValueLookupParameter<BoolValue> FillPopulationWithParentsParameter {
    115       get { return (IValueLookupParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
    116110    }
    117111    #endregion
     
    140134      Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions. This operator is executed in parallel, if an engine is used which supports parallelization."));
    141135      Parameters.Add(new ValueLookupParameter<IntValue>("Elites", "The numer of elite solutions which are kept in each generation."));
    142       Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    143136      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The results collection to store the results."));
    144137      Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to the analyze the villages."));
     
    153146      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."));
    154147      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."));
    156148      #endregion
    157149
     
    244236      mainOperator.CurrentSuccessRatioParameter.ActualName = "CurrentSuccessRatio";
    245237      mainOperator.ElitesParameter.ActualName = ElitesParameter.Name;
    246       mainOperator.ReevaluateElitesParameter.ActualName = ReevaluateElitesParameter.Name;
    247238      mainOperator.EvaluatedSolutionsParameter.ActualName = EvaluatedSolutionsParameter.Name;
    248239      mainOperator.EvaluatorParameter.ActualName = EvaluatorParameter.Name;
     
    257248      mainOperator.SelectorParameter.ActualName = SelectorParameter.Name;
    258249      mainOperator.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name;
    259       mainOperator.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
    260250
    261251      villageAnalyzer2.Name = "Village Analyzer (placeholder)";
     
    434424    }
    435425
    436     [StorableHook(HookType.AfterDeserialization)]
    437     private void AfterDeserialization() {
    438       // BackwardsCompatibility3.3
    439       #region Backwards compatible code, remove with 3.4
    440       if (!Parameters.ContainsKey("ReevaluateElites")) {
    441         Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    442       }
    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."));
    445       #endregion
    446     }
    447 
    448426    public override IOperation Apply() {
    449427      if (CrossoverParameter.ActualValue == null)
  • branches/HiveStatistics/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SuccessfulOffspringAnalysis/SuccessfulOffspringAnalyzer.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 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"));
    8683    }
    8784
     
    113110        }
    114111
    115         if (counts.Count > 0) {
    116           //create a data table containing the collected values
    117           ResultCollection successfulOffspringAnalysis;
     112        //create a data table containing the collected values
     113        ResultCollection successfulOffspringAnalysis;
    118114
    119           if (SuccessfulOffspringAnalysisParameter.ActualValue == null) {
    120             successfulOffspringAnalysis = new ResultCollection();
    121             SuccessfulOffspringAnalysisParameter.ActualValue = successfulOffspringAnalysis;
     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);
    122154          } else {
    123             successfulOffspringAnalysis = SuccessfulOffspringAnalysisParameter.ActualValue;
     155            row = successProgressAnalysis.Rows[value];
    124156          }
    125157
    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           }
     158          row.Values.Add(counts[value] / (double)successfulCount);
     159        }
    132160
    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           }
     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);
    170165        }
    171166      }
Note: See TracChangeset for help on using the changeset viewer.