Changeset 12951 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/EvolutionTrackingOperator.cs
- Timestamp:
- 09/15/15 00:10:33 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/EvolutionTrackingOperator.cs
r11227 r12951 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 31 31 [Item("EvolutionTrackingOperator", "A base operator which facilitates access to the genealogy graph.")] 32 32 [StorableClass] 33 public class EvolutionTrackingOperator<T> : SingleSuccessorOperator where T : class, IItem {33 public class EvolutionTrackingOperator<T> : SingleSuccessorOperator where T : class, IItem { 34 34 // evolution tracking-related parameters 35 private const string resultsParameterName = "Results";36 private const string populationGraphParameterName = "PopulationGraph";37 private const string generationsParameterName = "Generations";35 private const string ResultsParameterName = "Results"; 36 private const string PopulationGraphParameterName = "PopulationGraph"; 37 private const string GenerationsParameterName = "Generations"; 38 38 39 39 public ILookupParameter<ResultCollection> ResultsParameter { 40 get { return (ILookupParameter<ResultCollection>)Parameters[ resultsParameterName]; }40 get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; } 41 41 } 42 42 public ILookupParameter<IntValue> GenerationsParameter { 43 get { return (ILookupParameter<IntValue>)Parameters[ generationsParameterName]; }43 get { return (ILookupParameter<IntValue>)Parameters[GenerationsParameterName]; } 44 44 } 45 45 public ResultCollection Results { … … 52 52 get { 53 53 IResult result; 54 if (!Results.ContainsKey( populationGraphParameterName)) {55 result = new Result( populationGraphParameterName, new GenealogyGraph<T>());54 if (!Results.ContainsKey(PopulationGraphParameterName)) { 55 result = new Result(PopulationGraphParameterName, new GenealogyGraph<T>()); 56 56 Results.Add(result); 57 57 } else { 58 result = Results[ populationGraphParameterName];58 result = Results[PopulationGraphParameterName]; 59 59 } 60 60 var graph = (GenealogyGraph<T>)result.Value; … … 63 63 } 64 64 public EvolutionTrackingOperator() { 65 Parameters.Add(new LookupParameter<IntValue>( generationsParameterName));66 Parameters.Add(new LookupParameter<ResultCollection>( resultsParameterName));65 Parameters.Add(new LookupParameter<IntValue>(GenerationsParameterName)); 66 Parameters.Add(new LookupParameter<ResultCollection>(ResultsParameterName)); 67 67 } 68 68 protected EvolutionTrackingOperator(EvolutionTrackingOperator<T> original, Cloner cloner)
Note: See TracChangeset
for help on using the changeset viewer.