Changeset 13206


Ignore:
Timestamp:
11/17/15 12:15:00 (4 years ago)
Author:
pfleck
Message:

#2269 Fixed typos and renamed some stuff suggested by ascheibe and adapted project for mono.

  • The initialization of layer 0 is done similar to other algorithms where general initialization is done in the algorithm itself and variables used and produced during the main-loop is initialized in the main-loop-operator.
  • The GeneralizedRankSelector is used as default selector because it generally works the best (rank compensates the large quality range of multiple layers and high selection pressure via pressure-parameter). Proportional selection performs very badly because the selection pressure is too low for ALPS.
  • Concerning ReduceToPopulationSize in the EldersEmigrator, the behavior it is not completely clear in the original paper. Reducing the population to the population size seems the more logical way, therefore it is default. An empty layer could happen in extremely rare situations, but it never happens to me so far.
  • Concerning opening a new layer, when taking a closer look at the ages, all individual tends to be as old as possible, in the standard version with AgeInheritance==1. That means they usually get too old in exactly after the generation the AgeLimits for the current last layer states. This way it is not necessary to check if any individual becomes too old for the current last layer. For AgeInheritance<1 it can happen that there would actually be no need to open a new layer; however, it will be opened anyway.
Location:
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3
Files:
8 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithm.cs

    r13128 r13206  
    280280
    281281      Parameters.Add(new ValueParameter<IntValue>("NumberOfLayers", "The number of layers.", new IntValue(10)));
    282       Parameters.Add(new ValueParameter<IntValue>("PopulationSize", "The size of the population of solutions each layer.", new IntValue(100)));
     282      Parameters.Add(new ValueParameter<IntValue>("PopulationSize", "The size of the population of solutions in each layer.", new IntValue(100)));
    283283
    284284      Parameters.Add(new ConstrainedValueParameter<ISelector>("Selector", "The operator used to select solutions for reproduction."));
     
    293293      Parameters.Add(new ValueParameter<IntValue>("AgeGap", "The frequency of reseeding the lowest layer and scaling factor for the age-limits for the layers.", new IntValue(20)));
    294294      Parameters.Add(new ValueParameter<DoubleValue>("AgeInheritance", "A weight that determines the age of a child after crossover based on the older (1.0) and younger (0.0) parent.", new DoubleValue(1.0)) { Hidden = true });
    295       Parameters.Add(new ValueParameter<IntArray>("AgeLimits", "The maximum ages for the Layers.", new IntArray(new int[0])) { Hidden = true });
     295      Parameters.Add(new ValueParameter<IntArray>("AgeLimits", "The maximum age an individual is allowed to reach in a certain layer.", new IntArray(new int[0])) { Hidden = true });
    296296
    297297      Parameters.Add(new ValueParameter<IntValue>("MatingPoolRange", "The range of layers used for creating a mating pool. (1 = current + previous layer)", new IntValue(1)) { Hidden = true });
     
    309309      var initializeAgeProcessor = new UniformSubScopesProcessor();
    310310      var initializeAge = new VariableCreator() { Name = "Initialize Age" };
    311       var initializeCurrentPopulationSize = new SubScopesCounter() { Name = "Init CurrentPopulationCounter" };
     311      var initializeCurrentPopulationSize = new SubScopesCounter() { Name = "Initialize CurrentPopulationCounter" };
    312312      var initializeLocalEvaluatedSolutions = new Assigner() { Name = "Initialize LayerEvaluatedSolutions" };
    313313      var initializeGlobalEvaluatedSolutions = new DataReducer() { Name = "Initialize EvaluatedSolutions" };
  • branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithmMainLoop.cs

    r13128 r13206  
    142142
    143143      Parameters.Add(new ValueLookupParameter<IntValue>("NumberOfLayers", "The number of layers."));
    144       Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize", "The size of the population."));
     144      Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize", "The size of the population of solutions in each layer."));
    145145      Parameters.Add(new LookupParameter<IntValue>("CurrentPopulationSize", "The current size of the population."));
    146146
     
    156156      Parameters.Add(new ValueLookupParameter<IntValue>("AgeGap", "The frequency of reseeding the lowest layer and scaling factor for the age-limits for the layers."));
    157157      Parameters.Add(new ValueLookupParameter<DoubleValue>("AgeInheritance", "A weight that determines the age of a child after crossover based on the older (1.0) and younger (0.0) parent."));
    158       Parameters.Add(new ValueLookupParameter<IntArray>("AgeLimits", "The maximum ages for the Layers."));
     158      Parameters.Add(new ValueLookupParameter<IntArray>("AgeLimits", "The maximum age an individual is allowed to reach in a certain layer."));
    159159
    160160      Parameters.Add(new ValueLookupParameter<IntValue>("MatingPoolRange", "The range of sub - populations used for creating a mating pool. (1 = current + previous sub-population)"));
     
    271271      var selectorProsessor = new UniformSubScopesProcessor();
    272272      var eldersSelector = new EldersSelector();
    273       var shiftToRightMigrator = new UnidirectionalRingMigrator() { Name = "Shift elders to next Layer" };
     273      var shiftToRightMigrator = new UnidirectionalRingMigrator() { Name = "Shift elders to next layer" };
    274274      var mergingProsessor = new UniformSubScopesProcessor();
    275275      var mergingReducer = new MergingReducer();
     
    324324      var openNewLayerCalculator = new ExpressionCalculator() { Name = "OpenNewLayer = Generations >= AgeLimits[OpenLayers - 1]" };
    325325      var openNewLayerBranch = new ConditionalBranch() { Name = "OpenNewLayer?" };
    326       var layerCreator = new LastScopeCloner() { Name = "Create Layer" };
     326      var layerCreator = new LastLayerCloner() { Name = "Create Layer" };
    327327      var updateLayerNumber = new Assigner() { Name = "Layer = OpenLayers" };
    328328      var historyWiper = new ResultsHistoryWiper() { Name = "Clear History in Results" };
     
    354354      openNewLayerBranch.TrueBranch = layerCreator;
    355355
    356       layerCreator.NewScopeOperator = updateLayerNumber;
     356      layerCreator.NewLayerOperator = updateLayerNumber;
    357357      layerCreator.Successor = incrOpenLayers;
    358358
  • branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithmMainOperator.cs

    r13125 r13206  
    104104      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
    105105
    106       Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize", "The size of the population."));
     106      Parameters.Add(new ValueLookupParameter<IntValue>("PopulationSize", "The size of the population of solutions in each layer."));
    107107      Parameters.Add(new ValueLookupParameter<IOperator>("Selector", "The operator used to select solutions for reproduction."));
    108108      Parameters.Add(new ValueLookupParameter<IOperator>("Crossover", "The operator used to cross solutions."));
  • branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/EldersSelector.cs

    r13127 r13206  
    3131namespace HeuristicLab.Algorithms.ALPS {
    3232
    33   [Item("EldersSelector", "Select all individuals which are to old for their current layer.")]
     33  [Item("EldersSelector", "Select all individuals which are too old for their current layer.")]
    3434  [StorableClass]
    3535  public sealed class EldersSelector : Selector {
     
    5858      : base() {
    5959      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Age", "The age of individuals."));
    60       Parameters.Add(new LookupParameter<IntArray>("AgeLimits", "The maximum ages for the Layers."));
     60      Parameters.Add(new LookupParameter<IntArray>("AgeLimits", "The maximum age an individual is allowed to reach in a certain layer."));
    6161      Parameters.Add(new LookupParameter<IntValue>("NumberOfLayers", "The number of layers."));
    62       Parameters.Add(new LookupParameter<IntValue>("Layer", "The number of the current Layer."));
     62      Parameters.Add(new LookupParameter<IntValue>("Layer", "The number of the current layer."));
    6363    }
    6464
  • branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/HeuristicLab.Algorithms.ALPS-3.3.csproj

    r13129 r13206  
    137137    <Compile Include="Analyzers\OldestAverageYoungestAgeCalculator.cs" />
    138138    <Compile Include="EldersSelector.cs" />
    139     <Compile Include="LastScopeCloner.cs" />
     139    <Compile Include="LastLayerCloner.cs" />
    140140    <Compile Include="MatingPoolCreator.cs" />
    141141    <Compile Include="Plugin.cs" />
     
    148148  </ItemGroup>
    149149  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    150   <PropertyGroup>
    151     <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
    152 set ProjectDir=$(ProjectDir)
    153 set SolutionDir=$(SolutionDir)
    154 set Outdir=$(Outdir)
    155 
    156 call PreBuildEvent.cmd</PreBuildEvent>
    157   </PropertyGroup>
    158150  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
    159151       Other similar extension points exist, see Microsoft.Common.targets.
     
    163155  </Target>
    164156  -->
     157  <PropertyGroup>
     158    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
     159set ProjectDir=$(ProjectDir)
     160set SolutionDir=$(SolutionDir)
     161set Outdir=$(Outdir)
     162
     163call PreBuildEvent.cmd
     164</PreBuildEvent>
     165    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
     166export ProjectDir=$(ProjectDir)
     167export SolutionDir=$(SolutionDir)
     168
     169$SolutionDir/PreBuildEvent.sh
     170</PreBuildEvent>
     171  </PropertyGroup>
    165172</Project>
  • branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/LastLayerCloner.cs

    r13203 r13206  
    2929
    3030namespace HeuristicLab.Algorithms.ALPS {
    31   [Item("LastScopeCloner", "An operator that creates a new scope by cloning the current last one.")]
     31  [Item("LastLayerCloner", "An operator that creates a new layer by cloning the current last one.")]
    3232  [StorableClass]
    33   public sealed class LastScopeCloner : SingleSuccessorOperator {
    34     public OperatorParameter NewScopeOperatorParameter {
    35       get { return (OperatorParameter)Parameters["NewScopeOperator"]; }
     33  public sealed class LastLayerCloner : SingleSuccessorOperator {
     34    public OperatorParameter NewLayerOperatorParameter {
     35      get { return (OperatorParameter)Parameters["NewLayerOperator"]; }
    3636    }
    3737
    38     public IOperator NewScopeOperator {
    39       get { return NewScopeOperatorParameter.Value; }
    40       set { NewScopeOperatorParameter.Value = value; }
     38    public IOperator NewLayerOperator {
     39      get { return NewLayerOperatorParameter.Value; }
     40      set { NewLayerOperatorParameter.Value = value; }
    4141    }
    4242
    4343    [StorableConstructor]
    44     private LastScopeCloner(bool deserializing) : base(deserializing) { }
     44    private LastLayerCloner(bool deserializing) : base(deserializing) { }
    4545
    46     private LastScopeCloner(LastScopeCloner original, Cloner cloner)
     46    private LastLayerCloner(LastLayerCloner original, Cloner cloner)
    4747      : base(original, cloner) {
    4848    }
    4949    public override IDeepCloneable Clone(Cloner cloner) {
    50       return new LastScopeCloner(this, cloner);
     50      return new LastLayerCloner(this, cloner);
    5151    }
    5252
    53     public LastScopeCloner()
     53    public LastLayerCloner()
    5454      : base() {
    55       Parameters.Add(new OperatorParameter("NewScopeOperator", "An Operator that is performed on the new scope."));
     55      Parameters.Add(new OperatorParameter("NewLayerOperator", "An operator that is performed on the new layer."));
    5656    }
    5757
     
    7070
    7171      var next = new OperationCollection(base.Apply());
    72       if (NewScopeOperator != null)
    73         next.Insert(0, ExecutionContext.CreateOperation(NewScopeOperator, newScope));
     72      if (NewLayerOperator != null)
     73        next.Insert(0, ExecutionContext.CreateOperation(NewLayerOperator, newScope));
    7474      return next;
    7575    }
  • branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/MatingPoolCreator.cs

    r13128 r13206  
    2828
    2929namespace HeuristicLab.Algorithms.ALPS {
    30   [Item("MatingPoolCreator", "An operator which creating mating pools based on a set of sub-populations. For each sub-population, the individuals from the previous sub-population are copied into the current sub-population.")]
     30  [Item("MatingPoolCreator", "An operator which creates mating pools based on a set of sub-populations. For each sub-population, the individuals from the previous sub-population are copied into the current sub-population.")]
    3131  [StorableClass]
    3232  public sealed class MatingPoolCreator : SingleSuccessorOperator {
     
    4545    public MatingPoolCreator()
    4646      : base() {
    47       Parameters.Add(new ValueLookupParameter<IntValue>("MatingPoolRange", "The range of sub-populations used for creating a mating pool. (1 = current + previous sub-population", new IntValue(1)));
     47      Parameters.Add(new ValueLookupParameter<IntValue>("MatingPoolRange", "The range of sub-populations used for creating a mating pool. (1 = current + previous sub-population)", new IntValue(1)));
    4848    }
    4949
    5050    /// <summary>
    51     /// Copies the subscopes of the n previous scope into the current scope. (default n = 1)
     51    /// Copies the subscopes of the n previous scopes into the current scope. (default n = 1)
    5252    /// <pre>
    5353    ///          __ scope __              __ scope __
  • branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/Properties/AssemblyInfo.cs.frame

    r12018 r13206  
    5353// by using the '*' as shown below:
    5454[assembly: AssemblyVersion("3.3.0.0")]
    55 [assembly: AssemblyFileVersion("3.3.11.$WCREV$")]
     55[assembly: AssemblyFileVersion("3.3.12.$WCREV$")]
  • branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/ReseedingController.cs

    r13127 r13206  
    6161      Parameters.Add(new LookupParameter<IntValue>("Generations", "The current number of generations."));
    6262      Parameters.Add(new ValueLookupParameter<IntValue>("AgeGap", "The frequency of reseeding the lowest layer and scaling factor for the age-limits for the layers."));
    63       Parameters.Add(new OperatorParameter("FirstLayerOperator", "The Operator that is performed on the first layer if reseeding is required."));
     63      Parameters.Add(new OperatorParameter("FirstLayerOperator", "The operator that is performed on the first layer if reseeding is required."));
    6464    }
    6565
Note: See TracChangeset for help on using the changeset viewer.