Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10645


Ignore:
Timestamp:
03/21/14 15:17:02 (11 years ago)
Author:
mkommend
Message:

#1997: Merged recent trunk changes for OS algorithm into the branch.

Location:
branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm

  • branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.csproj

    r10152 r10645  
    141141      <Private>False</Private>
    142142    </Reference>
    143     <Reference Include="HeuristicLab.Selection-3.3">
     143    <Reference Include="HeuristicLab.Selection-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     144      <SpecificVersion>False</SpecificVersion>
    144145      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Selection-3.3.dll</HintPath>
    145146      <Private>False</Private>
     
    192193      <Install>true</Install>
    193194    </BootstrapperPackage>
     195  </ItemGroup>
     196  <ItemGroup>
     197    <WCFMetadata Include="Service References\" />
    194198  </ItemGroup>
    195199  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithm.cs

    r10389 r10645  
    133133      get { return (ValueParameter<IntValue>)Parameters["MaximumEvaluatedSolutions"]; }
    134134    }
     135    private IFixedValueParameter<BoolValue> FillPopulationWithParentsParameter {
     136      get { return (IFixedValueParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
     137    }
    135138    protected IFixedValueParameter<BoolValue> ReevaluateImmigrantsParameter {
    136139      get { return (IFixedValueParameter<BoolValue>)Parameters["ReevaluateImmigrants"]; }
     
    238241      get { return MaximumEvaluatedSolutionsParameter.Value; }
    239242      set { MaximumEvaluatedSolutionsParameter.Value = value; }
     243    }
     244    public bool FillPopulationWithParents {
     245      get { return FillPopulationWithParentsParameter.Value.Value; }
     246      set { FillPopulationWithParentsParameter.Value.Value = value; }
    240247    }
    241248    public bool ReevaluateImmigrants {
     
    281288        Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateImmigrants", "Flag which indicates if inviduals should be reevaluated before they are immigrated.", new BoolValue(false)) { Hidden = true });
    282289      }
     290      if (!Parameters.ContainsKey("FillPopulationWithParents"))
     291        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 });
    283292      #endregion
    284293
     
    325334      Parameters.Add(new ValueParameter<MultiAnalyzer>("IslandAnalyzer", "The operator used to analyze each island.", new MultiAnalyzer()));
    326335      Parameters.Add(new ValueParameter<IntValue>("MaximumEvaluatedSolutions", "The maximum number of evaluated solutions (approximately).", new IntValue(int.MaxValue)));
     336      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 });
    327337      Parameters.Add(new FixedValueParameter<BoolValue>("ReevaluateImmigrants", "Flag which indicates if inviduals should be reevaluated before they are immigrated.", new BoolValue(false)) { Hidden = true });
    328338
     
    390400      mainLoop.OffspringSelectionBeforeMutationParameter.ActualName = OffspringSelectionBeforeMutationParameter.Name;
    391401      mainLoop.EvaluatedSolutionsParameter.ActualName = "EvaluatedSolutions";
     402      mainLoop.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
    392403      mainLoop.Successor = null;
    393404
  • branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/IslandOffspringSelectionGeneticAlgorithmMainLoop.cs

    r10640 r10645  
    2020#endregion
    2121
    22 using System.Linq;
    2322using HeuristicLab.Common;
    2423using HeuristicLab.Core;
     
    2928using HeuristicLab.Parameters;
    3029using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    31 using HeuristicLab.Selection;
    3230
    3331namespace HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm {
     
    131129    public LookupParameter<IntValue> EvaluatedSolutionsParameter {
    132130      get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
     131    }
     132    public IValueLookupParameter<BoolValue> FillPopulationWithParentsParameter {
     133      get { return (IValueLookupParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
    133134    }
    134135    public ValueLookupParameter<BoolValue> ReevaluateIndividualsAfterMigration {
     
    179180      Parameters.Add(new ValueLookupParameter<IOperator>("IslandAnalyzer", "The operator used to analyze each island."));
    180181      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated."));
     182      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."));
    181183      Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateIndividualsAfterMigration", "Flag which indicates if inviduals should be reevaluated after migration."));
    182184      #endregion
     
    277279      mainOperator.SelectorParameter.ActualName = SelectorParameter.Name;
    278280      mainOperator.SuccessRatioParameter.ActualName = SuccessRatioParameter.Name;
    279       foreach (var offspringSelector in mainOperator.OperatorGraph.Operators.OfType<OffspringSelector>())
    280         offspringSelector.FillPopulationWithParents = true;
     281      mainOperator.FillPopulationWithParentsParameter.ActualName = FillPopulationWithParentsParameter.Name;
    281282
    282283      islandAnalyzer2.Name = "Island Analyzer (placeholder)";
     
    458459        Parameters.Add(new ValueLookupParameter<BoolValue>("ReevaluateElites", "Flag to determine if elite individuals should be reevaluated (i.e., if stochastic fitness functions are used.)"));
    459460      }
     461      if (!Parameters.ContainsKey("FillPopulationWithParents"))
     462        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."));
    460463      #endregion
    461464    }
  • branches/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs

    r9756 r10645  
    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/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs

    r9756 r10645  
    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/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainOperator.cs

    r9756 r10645  
    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/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASA.cs

    r9756 r10645  
    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/DataAnalysis.IslandAlgorithms/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SASEGASAMainLoop.cs

    r9756 r10645  
    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    }
Note: See TracChangeset for help on using the changeset viewer.