Changeset 5184 for branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/Crossovers
- Timestamp:
- 12/30/10 22:50:59 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/Encoding/Crossovers/ParameterConfigurationCrossover.cs
r5112 r5184 15 15 [Item("ParameterConfigurationCrossover", "TODO")] 16 16 [StorableClass] 17 public class ParameterConfigurationCrossover : SingleSuccessorOperator, IParameterConfigurationOperator, I Crossover {17 public class ParameterConfigurationCrossover : SingleSuccessorOperator, IParameterConfigurationOperator, IParameterConfigurationCrossover { 18 18 public override bool CanChangeName { 19 19 get { return false; } … … 23 23 get { return (LookupParameter<IRandom>)Parameters["Random"]; } 24 24 } 25 public ILookupParameter<ItemArray< IValueConfiguration>> ParentsParameter {26 get { return (ScopeTreeLookupParameter< IValueConfiguration>)Parameters["Parents"]; }25 public ILookupParameter<ItemArray<ParameterConfigurationTree>> ParentsParameter { 26 get { return (ScopeTreeLookupParameter<ParameterConfigurationTree>)Parameters["Parents"]; } 27 27 } 28 public ILookupParameter< IValueConfiguration> ChildParameter {29 get { return (ILookupParameter< IValueConfiguration>)Parameters["Child"]; }28 public ILookupParameter<ParameterConfigurationTree> ChildParameter { 29 get { return (ILookupParameter<ParameterConfigurationTree>)Parameters["Child"]; } 30 30 } 31 31 … … 43 43 : base() { 44 44 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic crossover operators.")); 45 Parameters.Add(new ScopeTreeLookupParameter<IValueConfiguration>("Parents", "The parent vectors which should be crossed.")); 46 ParentsParameter.ActualName = "ParameterConfigurationTree"; 47 Parameters.Add(new LookupParameter<IValueConfiguration>("Child", "The child vector resulting from the crossover.")); 48 ChildParameter.ActualName = "ParameterConfigurationTree"; 45 Parameters.Add(new ScopeTreeLookupParameter<ParameterConfigurationTree>("Parents", "The parent vectors which should be crossed.")); 46 Parameters.Add(new LookupParameter<ParameterConfigurationTree>("Child", "The child vector resulting from the crossover.")); 49 47 50 48 Parameters.Add(new ValueLookupParameter<IIntValueCrossover>(MetaOptimizationProblem.IntValueCrossoverParameterName, "")); … … 56 54 57 55 public override IOperation Apply() { 58 IValueConfiguration child1 = (IValueConfiguration)ParentsParameter.ActualValue[0].Clone();59 IValueConfiguration child2 = (IValueConfiguration)ParentsParameter.ActualValue[1];56 ParameterConfigurationTree child1 = (ParameterConfigurationTree)ParentsParameter.ActualValue[0].Clone(); 57 ParameterConfigurationTree child2 = (ParameterConfigurationTree)ParentsParameter.ActualValue[1]; 60 58 61 59 //child1.Cross(child2, RandomParameter.ActualValue);
Note: See TracChangeset
for help on using the changeset viewer.