Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11512


Ignore:
Timestamp:
10/30/14 12:01:16 (9 years ago)
Author:
ascheibe
Message:

#2267 minor fixes

Location:
branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm/OffspringCollector.cs

    r11511 r11512  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    4445    public override IOperation Apply() {
    4546      IScope scope = ExecutionContext.Scope;
     47
     48      if (scope.SubScopes.Count != 2) {
     49        throw new InvalidOperationException(Name + ": Wrong number of scopes.");
     50      }
     51
    4652      IScope offspring = scope.SubScopes[1];
     53
     54      if (GeneratedOffspringParameter.ActualValue == null) {
     55        throw new InvalidOperationException(Name + ": GeneratedOffspring list is not initialized. Have you forgotten to add the ProbabilitiesGenerator to the analyzers?");
     56      }
    4757
    4858      GeneratedOffspringParameter.ActualValue.AddRange(offspring.SubScopes);
  • branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm/ProbabilitiesGenerator.cs

    r11511 r11512  
    4444      get { return (ValueParameter<StringValue>)Parameters["OperatorNameVariable"]; }
    4545    }
    46     public LookupParameter<IOperator> CrossoverParameter {
    47       get { return (LookupParameter<IOperator>)Parameters["Crossover"]; }
     46    public LookupParameter<IOperator> OperatorParameter {
     47      get { return (LookupParameter<IOperator>)Parameters["Operator"]; }
    4848    }
    4949    public LookupParameter<DoubleArray> ProbablilitiesParameter {
     
    6868      Parameters.Add(new ValueParameter<StringValue>("SuccessfulOffspringFlag", "The name of the flag which indicates if the individual was successful.", new StringValue("SuccessfulOffspring")));
    6969      Parameters.Add(new ValueParameter<StringValue>("OperatorNameVariable", "The properties of the successful offspring that should be collected.", new StringValue("SelectedCrossoverOperator")));
    70       Parameters.Add(new LookupParameter<DoubleArray>("Probabilities"));
    71       Parameters.Add(new LookupParameter<IOperator>("Crossover"));
     70      Parameters.Add(new LookupParameter<DoubleArray>("Probabilities", "The probability vector a multi crossover/mutator uses to decide which operator to use"));
     71      Parameters.Add(new LookupParameter<IOperator>("Operator", "The multioperator that contains the list of used crossovers/mutators", "Crossover"));
    7272      Parameters.Add(new ValueParameter<DoubleValue>("MinimumOperatorUsage", "Minimum percentage of operator usage. ", new DoubleValue(0.05)));
    7373      Parameters.Add(new LookupParameter<ItemList<IScope>>("GeneratedOffspring", "Temporary store of the offspring population."));
     
    8585      Dictionary<string, int> successfulOperatorCount = new Dictionary<string, int>();
    8686
    87       var crossover = CrossoverParameter.ActualValue;
     87      var crossover = OperatorParameter.ActualValue;
    8888      if (crossover.GetType().GetInterfaces().Any(x => x.IsGenericType &&
    8989        x.GetGenericTypeDefinition() == typeof(ICheckedMultiOperator<>))) {
Note: See TracChangeset for help on using the changeset viewer.