Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/24/09 01:09:38 (15 years ago)
Author:
swagner
Message:

Adapted some of the XML code comments and some of the VariableInfo descriptions. Added a local default variable for ComparisonFactor. (#475)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Selection.OffspringSelection/WeightedOffspringFitnessComparer.cs

    r1178 r1223  
    4545    public WeightedOffspringFitnessComparer()
    4646      : 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)));
    5155    }
    5256
     
    5559    /// The result of this decision is added as variable "SuccessfulChild" into the scope.
    5660    /// </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>
    5862    /// <returns><c>null</c>.</returns>
    5963    public override IOperation Apply(IScope scope) {
     
    8286      else
    8387        successful = new BoolData(false);
    84      
    85       scope.AddVariable(new Variable(scope.TranslateName(GetVariableInfo("SuccessfulChild").FormalName), successful));
    8688
     89      scope.AddVariable(new Variable(scope.TranslateName("SuccessfulChild"), successful));
    8790      return null;
    8891    }
Note: See TracChangeset for help on using the changeset viewer.