Changeset 13725 for branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Analyzers/CrowdingAnalyzer.cs
- Timestamp:
- 03/24/16 12:30:32 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.MultiObjectiveTestFunctions/HeuristicLab.Problems.MultiObjectiveTestFunctions/3.3/Analyzers/CrowdingAnalyzer.cs
r13672 r13725 20 20 #endregion 21 21 using HeuristicLab.Common; 22 using HeuristicLab.Core; 22 23 using HeuristicLab.Data; 23 24 using HeuristicLab.Optimization; 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 26 25 27 namespace HeuristicLab.Problems.MultiObjectiveTestFunctions { 26 class CrowdingAnalyzer : MOTFAnalyzer { 27 28 protected CrowdingAnalyzer(CrowdingAnalyzer original, Cloner cloner) : base(original, cloner) { 28 [StorableClass] 29 [Item("CrowdingAnalyzer", "The mean crowding distance for each point of the Front (see Multi-Objective Performance Metrics - Shodhganga for more information)")] 30 public class CrowdingAnalyzer : MOTFAnalyzer { 31 [StorableHook(HookType.AfterDeserialization)] 32 private void AfterDeserialization() { 33 } 34 [StorableConstructor] 35 protected CrowdingAnalyzer(bool deserializing) : base(deserializing) { } 36 public CrowdingAnalyzer(CrowdingAnalyzer original, Cloner cloner) : base(original, cloner) { 29 37 } 30 38 public override IDeepCloneable Clone(Cloner cloner) { 31 39 return new CrowdingAnalyzer(this, cloner); 32 40 } 41 42 43 33 44 public CrowdingAnalyzer() { } 34 45 35 p rotectedoverride void Analyze(Individual[] individuals, double[][] qualities, ResultCollection results) {46 public override void Analyze(Individual[] individuals, double[][] qualities, ResultCollection results) { 36 47 int objectives = qualities[0].Length; 37 48 if (!results.ContainsKey("Crowding")) results.Add(new Result("Crowding", typeof(DoubleValue))); 38 results["Crowding"].Value = new DoubleValue(Crowding.Calculate(qualities, TestFunction .Bounds(objectives)));49 results["Crowding"].Value = new DoubleValue(Crowding.Calculate(qualities, TestFunctionParameter.ActualValue.Bounds(objectives))); 39 50 } 40 51 }
Note: See TracChangeset
for help on using the changeset viewer.