- Timestamp:
- 10/30/14 12:01:16 (10 years ago)
- Location:
- branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm/OffspringCollector.cs
r11511 r11512 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 44 45 public override IOperation Apply() { 45 46 IScope scope = ExecutionContext.Scope; 47 48 if (scope.SubScopes.Count != 2) { 49 throw new InvalidOperationException(Name + ": Wrong number of scopes."); 50 } 51 46 52 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 } 47 57 48 58 GeneratedOffspringParameter.ActualValue.AddRange(offspring.SubScopes); -
branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm/ProbabilitiesGenerator.cs
r11511 r11512 44 44 get { return (ValueParameter<StringValue>)Parameters["OperatorNameVariable"]; } 45 45 } 46 public LookupParameter<IOperator> CrossoverParameter {47 get { return (LookupParameter<IOperator>)Parameters[" Crossover"]; }46 public LookupParameter<IOperator> OperatorParameter { 47 get { return (LookupParameter<IOperator>)Parameters["Operator"]; } 48 48 } 49 49 public LookupParameter<DoubleArray> ProbablilitiesParameter { … … 68 68 Parameters.Add(new ValueParameter<StringValue>("SuccessfulOffspringFlag", "The name of the flag which indicates if the individual was successful.", new StringValue("SuccessfulOffspring"))); 69 69 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")); 72 72 Parameters.Add(new ValueParameter<DoubleValue>("MinimumOperatorUsage", "Minimum percentage of operator usage. ", new DoubleValue(0.05))); 73 73 Parameters.Add(new LookupParameter<ItemList<IScope>>("GeneratedOffspring", "Temporary store of the offspring population.")); … … 85 85 Dictionary<string, int> successfulOperatorCount = new Dictionary<string, int>(); 86 86 87 var crossover = CrossoverParameter.ActualValue;87 var crossover = OperatorParameter.ActualValue; 88 88 if (crossover.GetType().GetInterfaces().Any(x => x.IsGenericType && 89 89 x.GetGenericTypeDefinition() == typeof(ICheckedMultiOperator<>))) {
Note: See TracChangeset
for help on using the changeset viewer.