Changeset 1223 for trunk/sources/HeuristicLab.Selection.OffspringSelection
- Timestamp:
- 02/24/09 01:09:38 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Selection.OffspringSelection/WeightedOffspringFitnessComparer.cs
r1178 r1223 45 45 public WeightedOffspringFitnessComparer() 46 46 : base() { 47 AddVariableInfo(new VariableInfo("Maximization", "Whether the problem is a maximization or minimization problem", typeof(BoolData), VariableKind.In)); 48 AddVariableInfo(new VariableInfo("Quality", "The variable that stores the quality value", typeof(DoubleData), VariableKind.In)); 49 AddVariableInfo(new VariableInfo("SuccessfulChild", "If the child is successful", typeof(BoolData), VariableKind.New)); 50 AddVariableInfo(new VariableInfo("ComparisonFactor", "The comparison factor that weighs between the parents qualities", typeof(DoubleData), VariableKind.In)); 47 AddVariableInfo(new VariableInfo("Maximization", "True if the problem is a maximization problem", typeof(BoolData), VariableKind.In)); 48 AddVariableInfo(new VariableInfo("Quality", "Quality value", typeof(DoubleData), VariableKind.In)); 49 AddVariableInfo(new VariableInfo("SuccessfulChild", "True if the child is successful", typeof(BoolData), VariableKind.New)); 50 51 VariableInfo compFactorInfo = new VariableInfo("ComparisonFactor", "Factor for comparing the quality of a child with the qualities of its parents (0 = better than worst parent, 1 = better than best parent)", typeof(DoubleData), VariableKind.In); 52 compFactorInfo.Local = true; 53 AddVariableInfo(compFactorInfo); 54 AddVariable(new Variable("ComparisonFactor", new DoubleData(0.5))); 51 55 } 52 56 … … 55 59 /// The result of this decision is added as variable "SuccessfulChild" into the scope. 56 60 /// </summary> 57 /// <param name="scope">The scope whose offspring should be analyzed.</param>61 /// <param name="scope">The current scope which represents a new child.</param> 58 62 /// <returns><c>null</c>.</returns> 59 63 public override IOperation Apply(IScope scope) { … … 82 86 else 83 87 successful = new BoolData(false); 84 85 scope.AddVariable(new Variable(scope.TranslateName(GetVariableInfo("SuccessfulChild").FormalName), successful));86 88 89 scope.AddVariable(new Variable(scope.TranslateName("SuccessfulChild"), successful)); 87 90 return null; 88 91 }
Note: See TracChangeset
for help on using the changeset viewer.