Free cookie consent management tool by TermsFeed Policy Generator

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

#2321: Added option for treatment of solutions with equal quality values in NSGA-II.

File:
1 edited

Legend:

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

    r12012 r12034  
    7979      get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
    8080    }
     81    public IValueLookupParameter<BoolValue> TreatSolutionsWithEqualQualityAsDominatedParameter {
     82      get { return (ValueLookupParameter<BoolValue>)Parameters["TreatSolutionsWithEqualQualityAsDominated"]; }
     83    }
    8184    #endregion
    8285
    8386    [StorableConstructor]
    8487    protected NSGA2MainLoop(bool deserializing) : base(deserializing) { }
     88    [StorableHook(HookType.AfterDeserialization)]
     89    private void AfterDeserialization() {
     90      // BackwardsCompatibility3.3
     91      #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."));
     94      #endregion
     95    }
     96
    8597    protected NSGA2MainLoop(NSGA2MainLoop original, Cloner cloner) : base(original, cloner) { }
    8698    public NSGA2MainLoop()
     
    105117      Parameters.Add(new ValueLookupParameter<IOperator>("Analyzer", "The operator used to analyze each generation."));
    106118      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."));
    107120      #endregion
    108121
     
    171184      subScopesCounter.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
    172185
     186      rankAndCrowdingSorter.TreatSolutionsWithEqualQualityAsDominatedParameter.ActualName = TreatSolutionsWithEqualQualityAsDominatedParameter.Name;
    173187      rankAndCrowdingSorter.CrowdingDistanceParameter.ActualName = "CrowdingDistance";
    174188      rankAndCrowdingSorter.RankParameter.ActualName = "Rank";
Note: See TracChangeset for help on using the changeset viewer.