Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/31/15 13:18:59 (10 years ago)
Author:
pfleck
Message:

#2269 Added AgeInheritance as own type and value for consistent configuration.

Location:
branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3
Files:
2 edited

Legend:

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

    r12270 r12271  
    131131      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 });
    132132      Parameters.Add(new ValueParameter<IntValue>("BatchSize", "Number of inner iterations before updates and analyzers are fired.", new IntValue(100)) { Hidden = true });
    133       AgeInheritance = new ReductionOperation(ReductionOperations.Min);
    134133
    135134      var randomCreator = new RandomCreator();
     
    282281    }
    283282
     283    protected override ReductionOperations GetAgeInheritanceReduction(AgeInheritance ageInheritance) {
     284      switch (ageInheritance) {
     285        case ALPS.AgeInheritance.Older: return ReductionOperations.Min;
     286        case ALPS.AgeInheritance.Agerage: return ReductionOperations.Avg;
     287        case ALPS.AgeInheritance.Younger: return ReductionOperations.Max;
     288        default: throw new NotSupportedException("AgeInheritance " + ageInheritance + " is not supported.");
     289      }
     290    }
     291
    284292    protected override void ParameterizeStochasticOperator(IOperator @operator) {
    285293      var stochasticOperator = @operator as IStochasticOperator;
  • branches/ALPS/HeuristicLab.Algorithms.ALPS.SteadyState/3.3/AlpsSsGeneticAlgorithmMainOperator.cs

    r12259 r12271  
    4848      var mutator = new Placeholder() { Name = "Mutator (Placeholder)" };
    4949      var ageReducer = new DataReducer() { Name = "Calculate EvalsCreated" };
    50       var lastMoveReducer = new DataReducer() { Name = "Calculate LastMove" };
     50      var lastMoveAssigner = new Assigner() { Name = "Set LastMove" };
    5151      var subScopesRemover = new SubScopesRemover();
    5252      var evaluator = new Placeholder() { Name = "Evaluator (Placeholder)" };
     
    7171
    7272      ageReducer.ParameterToReduce.ActualName = "EvalsCreated";
    73       ageReducer.ReductionOperation.ActualName = "AgeInheritance";
     73      ageReducer.ReductionOperation.ActualName = "AgeInheritanceReduction";
    7474      ageReducer.ReductionOperation.Value = null;
    7575      ageReducer.TargetParameter.ActualName = "EvalsCreated";
    7676      ageReducer.TargetOperation.Value = new ReductionOperation(ReductionOperations.Assign);
    77       ageReducer.Successor = lastMoveReducer;
     77      ageReducer.Successor = lastMoveAssigner;
    7878
    79       lastMoveReducer.ParameterToReduce.ActualName = "LastMove";
    80       lastMoveReducer.ReductionOperation.ActualName = "AgeInheritance";
    81       lastMoveReducer.ReductionOperation.Value = null;
    82       lastMoveReducer.TargetParameter.ActualName = "LastMove";
    83       lastMoveReducer.TargetOperation.Value = new ReductionOperation(ReductionOperations.Assign);
    84       lastMoveReducer.Successor = subScopesRemover;
     79      lastMoveAssigner.LeftSideParameter.ActualName = "LastMove";
     80      lastMoveAssigner.RightSideParameter.ActualName = "EvaluatedSolutions";
     81      lastMoveAssigner.Successor = subScopesRemover;
    8582
    8683      subScopesRemover.Successor = evaluator;
Note: See TracChangeset for help on using the changeset viewer.