Changeset 7954 for branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.TestFunctions/3.3/Improvers
- Timestamp:
- 06/04/12 16:48:59 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.TestFunctions/3.3/Improvers/SingleObjectiveTestFunctionImprovementOperator.cs
r7789 r7954 45 45 get { return (IValueParameter<DoubleValue>)Parameters["Beta"]; } 46 46 } 47 public IValueLookupParameter<DoubleMatrix> BoundsParameter { 48 get { return (IValueLookupParameter<DoubleMatrix>)Parameters["Bounds"]; } 49 } 47 50 public ScopeParameter CurrentScopeParameter { 48 51 get { return (ScopeParameter)Parameters["CurrentScope"]; } … … 74 77 private DoubleValue Beta { 75 78 get { return BetaParameter.Value; } 79 } 80 private DoubleMatrix Bounds { 81 get { return BoundsParameter.ActualValue; } 76 82 } 77 83 public IScope CurrentScope { … … 109 115 Parameters.Add(new ValueParameter<DoubleValue>("Alpha", new DoubleValue(1.0))); 110 116 Parameters.Add(new ValueParameter<DoubleValue>("Beta", new DoubleValue(2.0))); 117 Parameters.Add(new ValueLookupParameter<DoubleMatrix>("Bounds")); 111 118 Parameters.Add(new ScopeParameter("CurrentScope")); 112 119 Parameters.Add(new ValueParameter<DoubleValue>("Delta", new DoubleValue(0.5))); … … 136 143 for (int i = 0; i < simplex.Length; i++) { 137 144 simplex[i] = bestSol.Clone() as RealVector; 138 simplex[i][i] += 0.1 * ( Evaluator.Bounds[0, 1] - Evaluator.Bounds[0, 0]);139 if (simplex[i][i] > Evaluator.Bounds[0, 1]) simplex[i][i] = Evaluator.Bounds[0, 1];140 if (simplex[i][i] < Evaluator.Bounds[0, 0]) simplex[i][i] = Evaluator.Bounds[0, 0];145 simplex[i][i] += 0.1 * (Bounds[0, 1] - Bounds[0, 0]); 146 if (simplex[i][i] > Bounds[0, 1]) simplex[i][i] = Bounds[0, 1]; 147 if (simplex[i][i] < Bounds[0, 0]) simplex[i][i] = Bounds[0, 0]; 141 148 } 142 149 … … 195 202 196 203 for (int i = 0; i < simplex[0].Length; i++) { 197 if (simplex[0][i] > Evaluator.Bounds[0, 1]) simplex[0][i] = Evaluator.Bounds[0, 1];198 if (simplex[0][i] < Evaluator.Bounds[0, 0]) simplex[0][i] = Evaluator.Bounds[0, 0];204 if (simplex[0][i] > Bounds[0, 1]) simplex[0][i] = Bounds[0, 1]; 205 if (simplex[0][i] < Bounds[0, 0]) simplex[0][i] = Bounds[0, 0]; 199 206 } 200 207
Note: See TracChangeset
for help on using the changeset viewer.