Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/26/11 18:39:49 (14 years ago)
Author:
abeham
Message:

#1395

  • Allowed to select the bounds checker to use in all RealVectorManipulator and RealVectorCrossover operators
  • Added a second bounds checker, the ReflectiveBoundsChecker which does not cut at the bounds, but mirrors the vector at the bounds
  • Use a repeating strategy in the move generators
  • Removed obsolete IRealVectorPSODecoder and IRealVectorPSOEncoder interfaces
  • Marked RealVectorToRealVectorEncoder as obsolete, internal and removed all meaningful code from it (it slipped into the release and should be thrown out as soon as possible)
  • Use a repeating strategy to stick within the bounds in the StdDevStrategyVectorManipulator when manipulating the mutation strengths
  • By default use smaller initial bounds in the StdDevStrategyVectorCreator (parameterized by the problem)
Location:
trunk/sources/HeuristicLab.Problems.TestFunctions/3.3
Files:
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/HeuristicLab.Problems.TestFunctions-3.3.csproj

    r5163 r5381  
    1212    <AssemblyName>HeuristicLab.Problems.TestFunctions-3.3</AssemblyName>
    1313    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    14     <TargetFrameworkProfile></TargetFrameworkProfile>
     14    <TargetFrameworkProfile>
     15    </TargetFrameworkProfile>
    1516    <FileAlignment>512</FileAlignment>
    1617    <SignAssembly>true</SignAssembly>
     
    128129    <Compile Include="Evaluators\ZakharovEvaluator.cs" />
    129130    <Compile Include="HeuristicLabProblemsTestFunctionsPlugin.cs" />
    130     <Compile Include="Interfaces\IRealVectorPSODecoder.cs" />
    131131    <Compile Include="Interfaces\IBestSingleObjectiveTestFunctionSolutionAnalyzer.cs" />
    132132    <Compile Include="Interfaces\IRastriginMoveEvaluator.cs" />
    133     <Compile Include="Interfaces\IRealVectorPSOEncoder.cs" />
    134133    <Compile Include="Interfaces\ISingleObjectiveTestFunctionAdditiveMoveEvaluator.cs" />
    135134    <Compile Include="Interfaces\ISingleObjectiveTestFunctionMoveEvaluator.cs" />
  • trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/RealVectorToRealVectorEncoder.cs

    r4722 r5381  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    24 using HeuristicLab.Data;
    25 using HeuristicLab.Encodings.RealVectorEncoding;
    2625using HeuristicLab.Operators;
    27 using HeuristicLab.Parameters;
    2826using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2927
    3028namespace HeuristicLab.Problems.TestFunctions {
    31   public class RealVectorToRealVectorEncoder : SingleSuccessorOperator, IRealVectorPSOEncoder, IRealVectorOperator {
    32     #region Parameters
    33 
    34     public IParameter OriginalRealVectorParameter {
    35       get { return (IParameter)Parameters["OriginalRealVector"]; }
    36     }
    37 
    38     public IParameter RealVectorParameter {
    39       get { return (IParameter)Parameters["RealVector"]; }
    40     }
    41 
    42     public ILookupParameter<IntValue> LengthParameter {
    43       get { return (ILookupParameter<IntValue>)Parameters["Length"]; }
    44     }
    45 
    46     public IValueLookupParameter<DoubleMatrix> BoundsParameter {
    47       get { return (IValueLookupParameter<DoubleMatrix>)Parameters["Bounds"]; }
    48     }
    49 
    50     protected ScopeParameter CurrentScopeParameter {
    51       get { return (ScopeParameter)Parameters["CurrentScope"]; }
    52     }
    53     #endregion
    54 
    55     public IScope CurrentScope {
    56       get { return CurrentScopeParameter.ActualValue; }
    57     }
     29  // BackwardsCompatibility3.3
     30  #region Backwards compatible code (remove with 3.4)
     31  [Obsolete("This operator should not be used anymore.")]
     32  internal class RealVectorToRealVectorEncoder : SingleSuccessorOperator {
    5833
    5934    [StorableConstructor]
     
    6237    public RealVectorToRealVectorEncoder()
    6338      : base() {
    64       Parameters.Add(new LookupParameter<RealVector>("OriginalRealVector", "The original real vector."));
    65       Parameters.Add(new LookupParameter<RealVector>("RealVector", "The resulting reference to the original real vector."));
    66       Parameters.Add(new LookupParameter<IntValue>("Length", "Vector length."));
    67       Parameters.Add(new ScopeParameter("CurrentScope", "The current scope bounds matrix should be cloned."));
    68       Parameters.Add(new ValueLookupParameter<DoubleMatrix>("Bounds", "The lower and upper bounds in each dimension."));
    6939    }
    7040
     
    7444
    7545    public override IOperation Apply() {
    76       RealVectorParameter.ActualValue = OriginalRealVectorParameter.ActualValue;
    77       IItem value = (IItem)BoundsParameter.ActualValue.Clone();
    78       CurrentScope.Variables.Add(new Variable("ParticleBounds", BoundsParameter.Description, value == null ? null : (IItem)value.Clone()));
    7946      return base.Apply();
    8047    }
     
    8451    }
    8552  }
     53  #endregion
    8654}
  • trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs

    r5287 r5381  
    403403        op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName;
    404404      }
    405       foreach (IRealVectorPSOEncoder op in Operators.OfType<IRealVectorPSOEncoder>()) {
    406         ((ILookupParameter)op.OriginalRealVectorParameter).ActualName = SolutionCreator.RealVectorParameter.ActualName;
    407         op.BoundsParameter.Value = (DoubleMatrix)BoundsParameter.Value.Clone();
    408         op.BoundsParameter.ActualName = "ParticleBounds";
    409       }
    410405    }
    411406    private void UpdateStrategyVectorBounds() {
    412407      DoubleMatrix strategyBounds = (DoubleMatrix)Bounds.Clone();
    413       for (int i = 0; i < strategyBounds.Rows; i++)
     408      for (int i = 0; i < strategyBounds.Rows; i++) {
    414409        if (strategyBounds[i, 0] < 0) strategyBounds[i, 0] = 0;
     410        strategyBounds[i, 1] = 0.1 * (Bounds[i, 1] - Bounds[i, 0]);
     411      }
    415412      strategyVectorCreator.BoundsParameter.Value = strategyBounds;
    416413    }
Note: See TracChangeset for help on using the changeset viewer.