Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12092


Ignore:
Timestamp:
02/27/15 10:54:37 (9 years ago)
Author:
pfleck
Message:

#2269

  • Use the new toint function of the ExpressionCalculator in the EldersEmigrator and remove the now obsolete MergingReducerCalculator.
  • Removed some parameters from the EldersMigrator because the AlpsGeneticAlgorithmMainLoop already defines those parameters.
Location:
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3
Files:
1 deleted
3 edited

Legend:

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

    r12071 r12092  
    274274
    275275      layerVariableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Layer", new IntValue(0)));
    276       //layerVariableCreator.CollectedValues.Add(new ValueParameter<ResultCollection>("Results", new ResultCollection()));
    277276      layerVariableCreator.Successor = layerSolutionsCreator;
    278277
     
    457456      MainLoop.MainOperator.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
    458457      MainLoop.MainOperator.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    459       MainLoop.EldersEmigrator.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name;
    460       MainLoop.EldersEmigrator.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName;
    461458      MainLoop.LayerUpdator.SolutionsCreator.NumberOfSolutionsParameter.ActualName = PopulationSizeParameter.Name;
    462459    }
  • branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/EldersEmigrator.cs

    r12035 r12092  
    2424using HeuristicLab.Data;
    2525using HeuristicLab.Operators;
     26using HeuristicLab.Optimization.Operators;
    2627using HeuristicLab.Parameters;
    2728using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    3233  [StorableClass]
    3334  public sealed class EldersEmigrator : AlgorithmOperator {
    34 
    35     public IValueLookupParameter<BoolValue> MaximizationParameter {
    36       get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; }
    37     }
    38     public IScopeTreeLookupParameter<DoubleValue> QualityParameter {
    39       get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
    40     }
    41 
    4235    [StorableConstructor]
    4336    private EldersEmigrator(bool deserializing)
     
    5043    public EldersEmigrator()
    5144      : base() {
    52       Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, otherwise false."));
    53       Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution."));
    54 
    5545      var selectorProsessor = new UniformSubScopesProcessor();
    5646      var eldersSelector = new EldersSelector();
     
    5949      var mergingReducer = new MergingReducer();
    6050      var subScopesCounter = new SubScopesCounter();
    61       // TODO: if expression calculator supports int, use expression calculator
    62       var countCalculator = new MergingReducerCalculator() { Name = "LayerPopulationSize = Min(LayerPopulationSize, PopulationSize)" };
    63       //var countCalculator = new ExpressionCalculator() { Name = "NumSubScopes = Min(NumSubScopes, PopulationSize)" };
     51      var countCalculator = new ExpressionCalculator() { Name = "LayerPopulationSize = Min(LayerPopulationSize, PopulationSize)" };
    6452      var bestSelector = new BestSelector();
    6553      var rightReducer = new RightReducer();
     
    8573      subScopesCounter.Successor = countCalculator;
    8674
    87       //countCalculator.CollectedValues.Add(new LookupParameter<IntValue>("PopulationSize"));
    88       //countCalculator.CollectedValues.Add(new LookupParameter<IntValue>("NumSubScopes"));
    89       //countCalculator.ExpressionParameter.Value = new StringValue("NumSubScopes PopulationSize NumSubScopes PopulationSize < if");
    90       //countCalculator.ExpressionResultParameter.ActualName = "NumSubScopes";
     75      countCalculator.CollectedValues.Add(new LookupParameter<IntValue>("PopulationSize"));
     76      countCalculator.CollectedValues.Add(new LookupParameter<IntValue>("LayerPopulationSize"));
     77      countCalculator.ExpressionParameter.Value = new StringValue("LayerPopulationSize PopulationSize LayerPopulationSize PopulationSize < if toint");
     78      countCalculator.ExpressionResultParameter.ActualName = "LayerPopulationSize";
    9179      countCalculator.Successor = bestSelector;
    9280
    9381      bestSelector.NumberOfSelectedSubScopesParameter.ActualName = "LayerPopulationSize";
    94       bestSelector.QualityParameter.ActualName = QualityParameter.Name;
    95       bestSelector.MaximizationParameter.ActualName = MaximizationParameter.Name;
    9682      bestSelector.CopySelected = new BoolValue(false);
    9783      bestSelector.Successor = rightReducer;
  • branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/HeuristicLab.Algorithms.ALPS-3.3.csproj

    r12084 r12092  
    147147    <Compile Include="NumberOfSelectedSubScopesCalculator.cs" />
    148148    <Compile Include="OpenNewLayerCalculator.cs" />
    149     <Compile Include="MergingReducerCalculator.cs" />
    150149    <Compile Include="Plugin.cs" />
    151150    <Compile Include="Properties\AssemblyInfo.cs" />
Note: See TracChangeset for help on using the changeset viewer.