Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12220 for branches/ALPS


Ignore:
Timestamp:
03/18/15 14:25:08 (10 years ago)
Author:
pfleck
Message:

#2350

  • Implemented elitism by sorting the layer and restricting the random target index.
  • Renamed Layers in LayersScope.
Location:
branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3
Files:
4 edited

Legend:

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

    r12192 r12220  
    134134
    135135      var randomCreator = new RandomCreator();
    136       var workingScopeCreator = new NamedSubScopesCreator() { Name = "Create WorkingScope and Layers-Scope" };
     136      var workingScopeCreator = new NamedSubScopesCreator() { Name = "Create Working- and Layers-Scope" };
    137137      var layersProcessor = new NamedSubScopeProcessor() { Name = "Process Layers-Scope" };
    138       var layerCreator = new SubScopesCreator() { Name = "Create Layer" };
    139       var layerProcessor = new /*Layer*/UniformSubScopesProcessor();
     138      var layerCreator = new SubScopesCreator() { Name = "Create Layers" };
     139      var layerProcessor = new UniformSubScopesProcessor();
    140140      var layerVariableCreator = new VariableCreator() { Name = "Initialize Layer" };
    141141      var layerNumberCreator = new ScopeIndexAssigner() { Name = "Create Layer Number" };
     
    155155      randomCreator.Successor = workingScopeCreator;
    156156
    157       workingScopeCreator.NamesParameter.Value = new StringArray(new[] { "WorkingScope", "Layers" });
     157      workingScopeCreator.NamesParameter.Value = new StringArray(new[] { "WorkingScope", "LayersScope", "ElitesScope" });
    158158      workingScopeCreator.Successor = layersProcessor;
    159159
    160       layersProcessor.TargetScopeParameter.ActualName = "Layers";
     160      layersProcessor.TargetScopeParameter.ActualName = "LayersScope";
    161161      layersProcessor.Operator = layerCreator;
    162162      layersProcessor.Successor = initializeEvaluatedSolutions;
     
    198198
    199199      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "ResultEvaluatedSolutions"));
     200      resultsCollector.CollectedValues.Add(new ScopeTreeLookupParameter<ResultCollection>("LayerResults", "Result set for each layer", "LayerResults", 2));
    200201      resultsCollector.Successor = mainLoop;
    201202
     
    204205      var tournamentSelector = SelectorParameter.ValidValues.OfType<TournamentSelector>().FirstOrDefault();
    205206      if (tournamentSelector != null) {
    206         tournamentSelector.GroupSizeParameter.Value = new IntValue(5);
     207        tournamentSelector.GroupSizeParameter.Value = new IntValue(4);
    207208        SelectorParameter.Value = tournamentSelector;
    208209      }
  • branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3/AlpsSsGeneticAlgorithmMainLoop.cs

    r12192 r12220  
    8686      var initializeAge = new Assigner() { Name = "Initialize Age" };
    8787      var removeEmptySubscope = new SubScopesRemover() { Name = "Remove empty subscope (from solutioncreator)" };
     88      var layerSorter = new SubScopesSorter() { Name = "Sort Layer" };
    8889      var selectRandomTargetIndex = new RandomIntAssigner();
    8990      var matingPoolCreator = new SteadyStateMatingPoolCreator() { Name = "Create MatingPool" };
     
    126127      resultsColletor.Successor = layersProcessor;
    127128
    128       layersProcessor.TargetScopeParameter.ActualName = "Layers";
     129      layersProcessor.TargetScopeParameter.ActualName = "LayersScope";
    129130      layersProcessor.Operator = initializeBatchIteration;
    130131
     
    144145      isLayerZeroBranch.ConditionParameter.ActualName = "IsLayerZero";
    145146      isLayerZeroBranch.TrueBranch = isDoInitBranch;
    146       isLayerZeroBranch.FalseBranch = selectRandomTargetIndex;
     147      isLayerZeroBranch.FalseBranch = layerSorter;
    147148      isLayerZeroBranch.Successor = tryMoveUp;
    148149
    149150      isDoInitBranch.ConditionParameter.ActualName = "DoInit";
    150151      isDoInitBranch.TrueBranch = setTargetIndedxToNextInit;
    151       isDoInitBranch.FalseBranch = selectRandomTargetIndex;
     152      isDoInitBranch.FalseBranch = layerSorter;
    152153
    153154      setTargetIndedxToNextInit.LeftSideParameter.ActualName = "TargetIndex";
     
    177178      initializeAge.RightSideParameter.ActualName = "EvaluatedSolutions";
    178179
     180      layerSorter.ValueParameter.ActualName = "Quality";
     181      layerSorter.DescendingParameter.ActualName = "Maximization";
     182      layerSorter.Successor = selectRandomTargetIndex;
     183
    179184      selectRandomTargetIndex.LeftSideParameter.ActualName = "TargetIndex";
    180       selectRandomTargetIndex.MinimumParameter.Value = new IntValue(0);
     185      selectRandomTargetIndex.MinimumParameter.ActualName = "Elites";
     186      selectRandomTargetIndex.MinimumParameter.Value = null;
    181187      selectRandomTargetIndex.MaximumParameter.ActualName = "LayerSize";
    182188      selectRandomTargetIndex.MaximumParameter.Value = null;
  • branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3/AlpsSsMover.cs

    r12174 r12220  
    5050      get { return (ILookupParameter<IScope>)Parameters["WorkingScope"]; }
    5151    }
    52     private ILookupParameter<IScope> LayersParameter {
    53       get { return (ILookupParameter<IScope>)Parameters["Layers"]; }
     52    private ILookupParameter<IScope> LayersScopeParameter {
     53      get { return (ILookupParameter<IScope>)Parameters["LayersScope"]; }
    5454    }
    5555    public ILookupParameter<IRandom> RandomParameter {
     
    9292      Parameters.Add(new LookupParameter<IntValue>("NumberOfLayers"));
    9393      Parameters.Add(new LookupParameter<IScope>("WorkingScope"));
    94       Parameters.Add(new LookupParameter<IScope>("Layers"));
     94      Parameters.Add(new LookupParameter<IScope>("LayersScope"));
    9595      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));
    9696      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality"));
     
    123123      maximization = MaximizationParameter.ActualValue.Value;
    124124
    125       layers = LayersParameter.ActualValue;
     125      layers = LayersScopeParameter.ActualValue;
    126126      var newIndividual = (IScope)WorkingScopeParameter.ActualValue.Clone();
    127127      newIndividual.Name = j.ToString();
  • branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3/SteadyStateMatingPoolCreator.cs

    r12192 r12220  
    3535      get { return (ILookupParameter<IScope>)Parameters["WorkingScope"]; }
    3636    }
    37     private ILookupParameter<IScope> LayersParameter {
    38       get { return (ILookupParameter<IScope>)Parameters["Layers"]; }
     37    private ILookupParameter<IScope> LayersScopeParameter {
     38      get { return (ILookupParameter<IScope>)Parameters["LayersScope"]; }
    3939    }
    4040    private ILookupParameter<IntValue> LayerParameter {
     
    6565      : base() {
    6666      Parameters.Add(new LookupParameter<IScope>("WorkingScope"));
    67       Parameters.Add(new LookupParameter<IScope>("Layers"));
     67      Parameters.Add(new LookupParameter<IScope>("LayersScope"));
    6868      Parameters.Add(new LookupParameter<IntValue>("Layer"));
    6969      Parameters.Add(new LookupParameter<IntArray>("AgeLimits"));
     
    7777      int layerNumber = LayerParameter.ActualValue.Value;
    7878      var workingScope = WorkingScopeParameter.ActualValue;
    79       var layers = LayersParameter.ActualValue;
     79      var layers = LayersScopeParameter.ActualValue;
    8080      var ageLimits = AgeLimitsParameter.ActualValue;
    8181      int numberOfLayers = NumberOfLayersParameter.ActualValue.Value;
Note: See TracChangeset for help on using the changeset viewer.