Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12044


Ignore:
Timestamp:
02/20/15 11:45:04 (10 years ago)
Author:
mkommend
Message:

#2321: Renamed parameter and parameter name to DominateOnEqualQualities.

Location:
branches/NSGA-II Changes
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/NSGA-II Changes/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2.cs

    r12034 r12044  
    8989    }
    9090
    91     private IFixedValueParameter<BoolValue> TreatSolutionsWithEqualQualityAsDominatedParameter {
    92       get { return (IFixedValueParameter<BoolValue>)Parameters["TreatSolutionsWithEqualQualityAsDominated"]; }
     91    private IFixedValueParameter<BoolValue> DominateOnEqualQualitiesParameter {
     92      get { return (IFixedValueParameter<BoolValue>)Parameters["DominateOnEqualQualities"]; }
    9393    }
    9494    #endregion
     
    139139      set { SelectedParentsParameter.Value = value; }
    140140    }
    141     public bool TreatSolutionsWithEqualQualityAsDominated {
    142       get { return TreatSolutionsWithEqualQualityAsDominatedParameter.Value.Value; }
    143       set { TreatSolutionsWithEqualQualityAsDominatedParameter.Value.Value = value; }
     141    public bool DominateOnEqualQualities {
     142      get { return DominateOnEqualQualitiesParameter.Value.Value; }
     143      set { DominateOnEqualQualitiesParameter.Value.Value = value; }
    144144    }
    145145
     
    180180      Parameters.Add(new ValueParameter<IntValue>("MaximumGenerations", "The maximum number of generations which should be processed.", new IntValue(1000)));
    181181      Parameters.Add(new ValueParameter<IntValue>("SelectedParents", "Each two parents form a new child, typically this value should be twice the population size, but because the NSGA-II is maximally elitist it can be any multiple of 2 greater than 0.", new IntValue(200)));
    182       Parameters.Add(new FixedValueParameter<BoolValue>("TreatSolutionsWithEqualQualityAsDominated", "Flag which determines wether solutions with equal quality values should be treated as dominated.", new BoolValue(false)));
     182      Parameters.Add(new FixedValueParameter<BoolValue>("DominateOnEqualQualities", "Flag which determines wether solutions with equal quality values should be treated as dominated.", new BoolValue(false)));
    183183
    184184      RandomCreator randomCreator = new RandomCreator();
     
    205205      subScopesCounter.Successor = rankAndCrowdingSorter;
    206206
    207       rankAndCrowdingSorter.TreatSolutionsWithEqualQualityAsDominatedParameter.ActualName = TreatSolutionsWithEqualQualityAsDominatedParameter.Name;
     207      rankAndCrowdingSorter.DominateOnEqualQualitiesParameter.ActualName = DominateOnEqualQualitiesParameter.Name;
    208208      rankAndCrowdingSorter.CrowdingDistanceParameter.ActualName = "CrowdingDistance";
    209209      rankAndCrowdingSorter.RankParameter.ActualName = "Rank";
     
    324324      // BackwardsCompatibility3.3
    325325      #region Backwards compatible code, remove with 3.4
    326       if (!Parameters.ContainsKey("TreatSolutionsWithEqualQualityAsDominated"))
    327         Parameters.Add(new FixedValueParameter<BoolValue>("TreatSolutionsWithEqualQualityAsDominated", "Flag which determines wether solutions with equal quality values should be treated as dominated.", new BoolValue(false)));
     326      if (!Parameters.ContainsKey("DominateOnEqualQualities"))
     327        Parameters.Add(new FixedValueParameter<BoolValue>("DominateOnEqualQualities", "Flag which determines wether solutions with equal quality values should be treated as dominated.", new BoolValue(false)));
    328328      #endregion
    329329
  • branches/NSGA-II Changes/HeuristicLab.Algorithms.NSGA2/3.3/NSGA2MainLoop.cs

    r12034 r12044  
    7979      get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
    8080    }
    81     public IValueLookupParameter<BoolValue> TreatSolutionsWithEqualQualityAsDominatedParameter {
    82       get { return (ValueLookupParameter<BoolValue>)Parameters["TreatSolutionsWithEqualQualityAsDominated"]; }
     81    public IValueLookupParameter<BoolValue> DominateOnEqualQualitiesParameter {
     82      get { return (ValueLookupParameter<BoolValue>)Parameters["DominateOnEqualQualities"]; }
    8383    }
    8484    #endregion
     
    9090      // BackwardsCompatibility3.3
    9191      #region Backwards compatible code, remove with 3.4
    92       if (!Parameters.ContainsKey("TreatSolutionsWithEqualQualityAsDominated"))
    93         Parameters.Add(new ValueLookupParameter<BoolValue>("TreatSolutionsWithEqualQualityAsDominated", "Flag which determines wether solutions with equal quality values should be treated as dominated."));
     92      if (!Parameters.ContainsKey("DominateOnEqualQualities"))
     93        Parameters.Add(new ValueLookupParameter<BoolValue>("DominateOnEqualQualities", "Flag which determines wether solutions with equal quality values should be treated as dominated."));
    9494      #endregion
    9595    }
     
    117117      Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze each generation."));
    118118      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated."));
    119       Parameters.Add(new ValueLookupParameter<BoolValue>("TreatSolutionsWithEqualQualityAsDominated", "Flag which determines wether solutions with equal quality values should be treated as dominated."));
     119      Parameters.Add(new ValueLookupParameter<BoolValue>("DominateOnEqualQualities", "Flag which determines wether solutions with equal quality values should be treated as dominated."));
    120120      #endregion
    121121
     
    184184      subScopesCounter.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
    185185
    186       rankAndCrowdingSorter.TreatSolutionsWithEqualQualityAsDominatedParameter.ActualName = TreatSolutionsWithEqualQualityAsDominatedParameter.Name;
     186      rankAndCrowdingSorter.DominateOnEqualQualitiesParameter.ActualName = DominateOnEqualQualitiesParameter.Name;
    187187      rankAndCrowdingSorter.CrowdingDistanceParameter.ActualName = "CrowdingDistance";
    188188      rankAndCrowdingSorter.RankParameter.ActualName = "Rank";
  • branches/NSGA-II Changes/HeuristicLab.Optimization.Operators/3.3/MultiObjective/FastNonDominatedSort.cs

    r12034 r12044  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.Drawing;
    2524using System.Linq;
    2625using HeuristicLab.Common;
     
    4645      get { return (IValueLookupParameter<BoolArray>)Parameters["Maximization"]; }
    4746    }
    48     public IValueLookupParameter<BoolValue> TreatSolutionsWithEqualQualityAsDominatedParameter {
    49       get { return (ValueLookupParameter<BoolValue>)Parameters["TreatSolutionsWithEqualQualityAsDominated"]; }
     47    public IValueLookupParameter<BoolValue> DominateOnEqualQualitiesParameter {
     48      get { return (ValueLookupParameter<BoolValue>)Parameters["DominateOnEqualQualities "]; }
    5049    }
    5150    public IScopeTreeLookupParameter<DoubleArray> QualitiesParameter {
     
    6261    public FastNonDominatedSort() {
    6362      Parameters.Add(new ValueLookupParameter<BoolArray>("Maximization", "Whether each objective is maximization or minimization."));
    64       Parameters.Add(new ValueLookupParameter<BoolValue>("TreatSolutionsWithEqualQualityAsDominated", "Flag which determines wether solutions with equal quality values should be treated as dominated."));
     63      Parameters.Add(new ValueLookupParameter<BoolValue>("DominateOnEqualQualities ", "Flag which determines wether solutions with equal quality values should be treated as dominated."));
    6564      Parameters.Add(new ScopeTreeLookupParameter<DoubleArray>("Qualities", "The qualities of a solution.", 1));
    6665      Parameters.Add(new ScopeTreeLookupParameter<IntValue>("Rank", "The rank of a solution.", 1));
     
    6867
    6968    public override IOperation Apply() {
    70       bool treatSolutionsWithEqualQualityAsDominated = TreatSolutionsWithEqualQualityAsDominatedParameter.ActualValue.Value;
     69      bool dominateOnEqualQualities = DominateOnEqualQualitiesParameter.ActualValue.Value;
    7170      BoolArray maximization = MaximizationParameter.ActualValue;
    7271      ItemArray<DoubleArray> qualities = QualitiesParameter.ActualValue;
     
    8685          dominatedScopes[p] = new List<int>();
    8786        for (int qI = pI + 1; qI < populationSize; qI++) {
    88           DominationResult test = Dominates(qualities[pI], qualities[qI], maximization, treatSolutionsWithEqualQualityAsDominated);
     87          DominationResult test = Dominates(qualities[pI], qualities[qI], maximization, dominateOnEqualQualities);
    8988          if (test == DominationResult.Dominates) {
    9089            dominatedScopes[p].Add(qI);
     
    141140    }
    142141
    143     private static DominationResult Dominates(DoubleArray left, DoubleArray right, BoolArray maximizations, bool treatSolutionsWithEqualQualityAsDominated) {
    144       if (treatSolutionsWithEqualQualityAsDominated && left.SequenceEqual(right)) return DominationResult.Dominates;
     142    private static DominationResult Dominates(DoubleArray left, DoubleArray right, BoolArray maximizations, bool dominateOnEqualQualities) {
     143      if (dominateOnEqualQualities && left.SequenceEqual(right)) return DominationResult.Dominates;
    145144
    146145      bool leftIsBetter = false, rightIsBetter = false;
     
    174173      // BackwardsCompatibility3.3
    175174      #region Backwards compatible code, remove with 3.4
    176       if (!Parameters.ContainsKey("TreatSolutionsWithEqualQualityAsDominated"))
    177         Parameters.Add(new ValueLookupParameter<BoolValue>("TreatSolutionsWithEqualQualityAsDominated", "Flag which determines wether solutions with equal quality values should be treated as dominated."));
     175      if (!Parameters.ContainsKey("DominateOnEqualQualities "))
     176        Parameters.Add(new ValueLookupParameter<BoolValue>("DominateOnEqualQualities ", "Flag which determines wether solutions with equal quality values should be treated as dominated."));
    178177      #endregion
    179178    }
  • branches/NSGA-II Changes/HeuristicLab.Optimization.Operators/3.3/MultiObjective/RankAndCrowdingSorter.cs

    r12034 r12044  
    4343      get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["CrowdingDistance"]; }
    4444    }
    45     public IValueLookupParameter<BoolValue> TreatSolutionsWithEqualQualityAsDominatedParameter {
    46       get { return (ValueLookupParameter<BoolValue>)Parameters["TreatSolutionsWithEqualQualityAsDominated"]; }
     45    public IValueLookupParameter<BoolValue> DominateOnEqualQualitiesParameter {
     46      get { return (ValueLookupParameter<BoolValue>)Parameters["DominateOnEqualQualities "]; }
    4747    }
    4848    #endregion
     
    5454      : base() {
    5555      Parameters.Add(new ValueLookupParameter<BoolArray>("Maximization", "For each objective a value that is true if that objective should be maximized, or false if it should be minimized."));
    56       Parameters.Add(new ValueLookupParameter<BoolValue>("TreatSolutionsWithEqualQualityAsDominated", "Flag which determines wether solutions with equal quality values should be treated as dominated."));
     56      Parameters.Add(new ValueLookupParameter<BoolValue>("DominateOnEqualQualities ", "Flag which determines wether solutions with equal quality values should be treated as dominated."));
    5757      Parameters.Add(new ScopeTreeLookupParameter<DoubleArray>("Qualities", "The vector of quality values."));
    5858      Parameters.Add(new ScopeTreeLookupParameter<IntValue>("Rank", "The rank of a solution (to which front it belongs)."));
     
    6666
    6767      fastNonDominatedSort.MaximizationParameter.ActualName = MaximizationParameter.Name;
    68       fastNonDominatedSort.TreatSolutionsWithEqualQualityAsDominatedParameter.ActualName = TreatSolutionsWithEqualQualityAsDominatedParameter.Name;
     68      fastNonDominatedSort.DominateOnEqualQualitiesParameter.ActualName = DominateOnEqualQualitiesParameter.Name;
    6969      fastNonDominatedSort.QualitiesParameter.ActualName = QualitiesParameter.Name;
    7070      fastNonDominatedSort.RankParameter.ActualName = RankParameter.Name;
     
    9393      // BackwardsCompatibility3.3
    9494      #region Backwards compatible code, remove with 3.4
    95       if (!Parameters.ContainsKey("TreatSolutionsWithEqualQualityAsDominated"))
    96         Parameters.Add(new ValueLookupParameter<BoolValue>("TreatSolutionsWithEqualQualityAsDominated", "Flag which determines wether solutions with equal quality values should be treated as dominated."));
     95      if (!Parameters.ContainsKey("DominateOnEqualQualities "))
     96        Parameters.Add(new ValueLookupParameter<BoolValue>("DominateOnEqualQualities ", "Flag which determines wether solutions with equal quality values should be treated as dominated."));
    9797      #endregion
    9898    }
Note: See TracChangeset for help on using the changeset viewer.