Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/04/12 16:48:59 (13 years ago)
Author:
jkarder
Message:

#1331:

  • added EvaluatedSolutions parameter
  • SingleObjectiveTestFunctionImprovementOperator now retrieves the bounds from the scope tree
  • SingleObjectiveTestFunctionProblem now assigns the bounds to the similarity calculator
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.TestFunctions/3.3/Improvers/SingleObjectiveTestFunctionImprovementOperator.cs

    r7789 r7954  
    4545      get { return (IValueParameter<DoubleValue>)Parameters["Beta"]; }
    4646    }
     47    public IValueLookupParameter<DoubleMatrix> BoundsParameter {
     48      get { return (IValueLookupParameter<DoubleMatrix>)Parameters["Bounds"]; }
     49    }
    4750    public ScopeParameter CurrentScopeParameter {
    4851      get { return (ScopeParameter)Parameters["CurrentScope"]; }
     
    7477    private DoubleValue Beta {
    7578      get { return BetaParameter.Value; }
     79    }
     80    private DoubleMatrix Bounds {
     81      get { return BoundsParameter.ActualValue; }
    7682    }
    7783    public IScope CurrentScope {
     
    109115      Parameters.Add(new ValueParameter<DoubleValue>("Alpha", new DoubleValue(1.0)));
    110116      Parameters.Add(new ValueParameter<DoubleValue>("Beta", new DoubleValue(2.0)));
     117      Parameters.Add(new ValueLookupParameter<DoubleMatrix>("Bounds"));
    111118      Parameters.Add(new ScopeParameter("CurrentScope"));
    112119      Parameters.Add(new ValueParameter<DoubleValue>("Delta", new DoubleValue(0.5)));
     
    136143      for (int i = 0; i < simplex.Length; i++) {
    137144        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];
    141148      }
    142149
     
    195202
    196203      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];
    199206      }
    200207
Note: See TracChangeset for help on using the changeset viewer.