Changeset 11593
- Timestamp:
- 11/27/14 10:41:15 (10 years ago)
- Location:
- branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/BinaryEncoding.cs
r11588 r11593 72 72 public BinaryEncoding(string name, int length) 73 73 : base(name) { 74 LengthParameter = new FixedValueParameter<IntValue>(Name + "Length", new IntValue(length)); 74 lengthParameter = new FixedValueParameter<IntValue>(Name + ".Length", new IntValue(length)); 75 Parameters.Add(lengthParameter); 76 75 77 SolutionCreator = new RandomBinaryVectorCreator(); 76 78 RegisterParameterEvents(); -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/IntegerEncoding.cs
r11588 r11593 102 102 if (step.HasValue) bounds[0, 2] = step.Value; 103 103 104 LengthParameter = new FixedValueParameter<IntValue>(Name + "Length", new IntValue(length)); 105 BoundsParameter = new ValueParameter<IntMatrix>(Name + "Bounds", bounds); 104 lengthParameter = new FixedValueParameter<IntValue>(Name + ".Length", new IntValue(length)); 105 boundsParameter = new ValueParameter<IntMatrix>(Name + ".Bounds", bounds); 106 Parameters.Add(lengthParameter); 107 Parameters.Add(boundsParameter); 106 108 107 109 SolutionCreator = new UniformRandomIntegerVectorCreator(); … … 123 125 } 124 126 125 LengthParameter = new FixedValueParameter<IntValue>(Name + " Length", new IntValue(length));126 BoundsParameter = new ValueParameter<IntMatrix>(Name + " Bounds", bounds);127 LengthParameter = new FixedValueParameter<IntValue>(Name + ".Length", new IntValue(length)); 128 BoundsParameter = new ValueParameter<IntMatrix>(Name + ".Bounds", bounds); 127 129 128 130 SolutionCreator = new UniformRandomIntegerVectorCreator(); -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/PermutationEncoding.cs
r11588 r11593 95 95 public PermutationEncoding(string name, int length, PermutationTypes type) 96 96 : base(name) { 97 LengthParameter = new FixedValueParameter<IntValue>(Name + "Length", new IntValue(length)); 98 PermutationTypeParameter = new FixedValueParameter<PermutationType>(Name + "Type", new PermutationType(type)); 97 lengthParameter = new FixedValueParameter<IntValue>(Name + ".Length", new IntValue(length)); 98 permutationTypeParameter = new FixedValueParameter<PermutationType>(Name + ".Type", new PermutationType(type)); 99 Parameters.Add(lengthParameter); 100 Parameters.Add(permutationTypeParameter); 99 101 100 102 SolutionCreator = new RandomPermutationCreator(); … … 194 196 private void ConfigureInversionMoveOperators(IEnumerable<IPermutationInversionMoveOperator> inversionMoveOperators) { 195 197 foreach (var inversionMoveOperator in inversionMoveOperators) { 196 inversionMoveOperator.InversionMoveParameter.ActualName = Name + " _InversionMove";198 inversionMoveOperator.InversionMoveParameter.ActualName = Name + ".InversionMove"; 197 199 } 198 200 } 199 201 private void ConfigureScrambleMoveOperators(IEnumerable<IPermutationScrambleMoveOperator> scrambleMoveOperators) { 200 202 foreach (var scrambleMoveOperator in scrambleMoveOperators) { 201 scrambleMoveOperator.ScrambleMoveParameter.ActualName = Name + " _ScambleMove";203 scrambleMoveOperator.ScrambleMoveParameter.ActualName = Name + ".ScambleMove"; 202 204 } 203 205 } 204 206 private void ConfigureSwap2MoveOperators(IEnumerable<IPermutationSwap2MoveOperator> swap2MoveOperators) { 205 207 foreach (var swap2MoveOperator in swap2MoveOperators) { 206 swap2MoveOperator.Swap2MoveParameter.ActualName = Name + " _Swap2Move";208 swap2MoveOperator.Swap2MoveParameter.ActualName = Name + ".Swap2Move"; 207 209 } 208 210 } 209 211 private void ConfigureTranslocationMoveOperators(IEnumerable<IPermutationTranslocationMoveOperator> translocationMoveOperators) { 210 212 foreach (var translocationMoveOperator in translocationMoveOperators) { 211 translocationMoveOperator.TranslocationMoveParameter.ActualName = Name + " _TranslocationMove";213 translocationMoveOperator.TranslocationMoveParameter.ActualName = Name + ".TranslocationMove"; 212 214 } 213 215 } -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Encodings/RealEncoding.cs
r11588 r11593 100 100 bounds[0, 1] = max; 101 101 102 LengthParameter = new FixedValueParameter<IntValue>(Name + "Length", new IntValue(length)); 103 BoundsParameter = new ValueParameter<DoubleMatrix>(Name + "Bounds", bounds); 102 lengthParameter = new FixedValueParameter<IntValue>(Name + ".Length", new IntValue(length)); 103 boundsParameter = new ValueParameter<DoubleMatrix>(Name + ".Bounds", bounds); 104 Parameters.Add(lengthParameter); 105 Parameters.Add(boundsParameter); 104 106 105 107 SolutionCreator = new UniformRandomRealVectorCreator(); … … 119 121 bounds[i, 1] = max[i]; 120 122 } 121 LengthParameter = new FixedValueParameter<IntValue>(Name + " Length", new IntValue(length));122 BoundsParameter = new ValueParameter<DoubleMatrix>(Name + " Bounds", bounds);123 LengthParameter = new FixedValueParameter<IntValue>(Name + ".Length", new IntValue(length)); 124 BoundsParameter = new ValueParameter<DoubleMatrix>(Name + ".Bounds", bounds); 123 125 124 126 SolutionCreator = new UniformRandomRealVectorCreator(); … … 228 230 var p = sm.StrategyParameterParameter as ILookupParameter; 229 231 if (p != null) { 230 p.ActualName = Name + " Strategy";232 p.ActualName = Name + ".Strategy"; 231 233 } 232 234 } … … 244 246 c.BoundsParameter.Value = (DoubleMatrix)bounds.Clone(); 245 247 c.LengthParameter.ActualName = LengthParameter.Name; 246 c.StrategyParameterParameter.ActualName = Name + " Strategy";248 c.StrategyParameterParameter.ActualName = Name + ".Strategy"; 247 249 } 248 250 var m = s as IRealVectorStdDevStrategyParameterManipulator; 249 251 if (m != null) { 250 252 m.BoundsParameter.Value = (DoubleMatrix)bounds.Clone(); 251 m.StrategyParameterParameter.ActualName = Name + " Strategy";253 m.StrategyParameterParameter.ActualName = Name + ".Strategy"; 252 254 } 253 255 var mm = s as StdDevStrategyVectorManipulator; … … 258 260 var x = s as IRealVectorStdDevStrategyParameterCrossover; 259 261 if (x != null) { 260 x.ParentsParameter.ActualName = Name + " Strategy";261 x.StrategyParameterParameter.ActualName = Name + " Strategy";262 x.ParentsParameter.ActualName = Name + ".Strategy"; 263 x.StrategyParameterParameter.ActualName = Name + ".Strategy"; 262 264 } 263 265 } … … 304 306 private void ConfigureAdditiveMoveOperator(IEnumerable<IAdditiveRealVectorMoveOperator> additiveMoveOperators) { 305 307 foreach (var additiveMoveOperator in additiveMoveOperators) { 306 additiveMoveOperator.AdditiveMoveParameter.ActualName = Name + " _AdditiveMove";308 additiveMoveOperator.AdditiveMoveParameter.ActualName = Name + ".AdditiveMove"; 307 309 } 308 310 } -
branches/ProgrammableProblem/HeuristicLab.Problems.Programmable/3.3/Operators/MultiEncodingOperator.cs
r11587 r11593 45 45 if (Parameters.ContainsKey(encoding.Name)) throw new ArgumentException(string.Format("Encoding {0} was already added.", encoding.Name)); 46 46 var param = new ConstrainedValueParameter<T>(encoding.Name, new ItemSet<T>(encoding.Operators.OfType<T>())); 47 47 param.Value = param.ValidValues.First(); 48 48 Parameters.Add(param); 49 49 }
Note: See TracChangeset
for help on using the changeset viewer.