Changeset 11587 for branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/RealEncoding.cs
- Timestamp:
- 11/26/14 13:24:20 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/RealEncoding.cs
r11582 r11587 62 62 63 63 public override IEnumerable<IValueParameter> Parameters { 64 get { return base.Parameters.Concat(new IValueParameter[] { LengthParameter, BoundsParameter }); }64 get { return new IValueParameter[] { LengthParameter, BoundsParameter }; } 65 65 } 66 66 #endregion … … 101 101 lengthParameter = new FixedValueParameter<IntValue>(Name + "Length", new IntValue(length)); 102 102 boundsParameter = new ValueParameter<DoubleMatrix>(Name + "Bounds", bounds); 103 104 SolutionCreator = new UniformRandomRealVectorCreator(); 103 105 RegisterParameterEvents(); 104 106 DiscoverOperators(); 105 SolutionCreator = Operators.OfType<UniformRandomRealVectorCreator>().Single();106 107 } 107 108 … … 119 120 lengthParameter = new FixedValueParameter<IntValue>(Name + "Length", new IntValue(length)); 120 121 boundsParameter = new ValueParameter<DoubleMatrix>(Name + "Bounds", bounds); 122 123 SolutionCreator = new UniformRandomRealVectorCreator(); 121 124 RegisterParameterEvents(); 122 125 DiscoverOperators(); 123 SolutionCreator = Operators.OfType<UniformRandomRealVectorCreator>().Single();124 126 } 125 127 … … 167 169 var discoveredTypes = ApplicationManager.Manager.GetTypes(encodingSpecificOperatorTypes, true, false, false); 168 170 var operators = discoveredTypes.Select(t => (IOperator)Activator.CreateInstance(t)); 169 var newOperators = operators.Except( encodingOperators, new TypeEqualityComparer<IOperator>()).ToList();171 var newOperators = operators.Except(Operators, new TypeEqualityComparer<IOperator>()).ToList(); 170 172 171 173 ConfigureOperators(newOperators); 172 encodingOperators.AddRange(newOperators); 174 foreach (var @operator in newOperators) 175 encodingOperators.Add(@operator); 173 176 174 177 foreach (var strategyVectorCreator in Operators.OfType<IRealVectorStdDevStrategyParameterCreator>())
Note: See TracChangeset
for help on using the changeset viewer.