Changeset 10830 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeCrossoverOperator.cs
- Timestamp:
- 05/09/14 15:11:16 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeCrossoverOperator.cs
r10675 r10830 33 33 [Item("AfterCrossoverOperator", "A generic operator that can record genealogical relationships between crossover parents and children.")] 34 34 public class BeforeCrossoverOperator<T> : EvolutionTrackingOperator<T>, ICrossoverOperator<T> where T : class,IItem { 35 private const string defaultParentsParameterName = "Parents";36 private const string defaultChildParameterName = "Child";35 private const string ParentsParameterName = "Parents"; 36 private const string ChildParameterName = "Child"; 37 37 38 public IScopeTreeLookupParameter<T> ParentsParameter { get; set; } 39 public ILookupParameter<T> ChildParameter { get; set; } 38 public IScopeTreeLookupParameter<T> ParentsParameter { 39 get { return (IScopeTreeLookupParameter<T>)Parameters[ParentsParameterName]; } 40 } 41 public ILookupParameter<T> ChildParameter { 42 get { return (ILookupParameter<T>)Parameters[ChildParameterName]; } 43 } 40 44 41 45 protected BeforeCrossoverOperator(BeforeCrossoverOperator<T> original, Cloner cloner) … … 47 51 48 52 public BeforeCrossoverOperator() { 49 ParentsParameter = new ScopeTreeLookupParameter<T>(defaultParentsParameterName); 50 ChildParameter = new LookupParameter<T>(defaultChildParameterName); 51 Parameters.Add(ParentsParameter); 52 Parameters.Add(ChildParameter); 53 Parameters.Add(new ScopeTreeLookupParameter<T>(ParentsParameterName)); 54 Parameters.Add(new LookupParameter<T>(ChildParameterName)); 53 55 } 54 56
Note: See TracChangeset
for help on using the changeset viewer.