Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/24/15 16:01:02 (9 years ago)
Author:
mkommend
Message:

#2521: Adapted real vector encoding, test function problems, P3, CMA-ES and optimization.

Location:
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorCreator.cs

    r12012 r13361  
    2828  /// An interface which represents an operator for creating vectors of real-valued data.
    2929  /// </summary>
    30   public interface IRealVectorCreator : IRealVectorOperator, ISolutionCreator {
     30  public interface IRealVectorCreator : IRealVectorOperator, ISolutionCreator<RealVector> {
    3131    IValueLookupParameter<IntValue> LengthParameter { get; }
    3232    IValueLookupParameter<DoubleMatrix> BoundsParameter { get; }
  • branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVector.cs

    r12012 r13361  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Data;
     25using HeuristicLab.Optimization;
    2526using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2627
     
    2829  [StorableClass]
    2930  [Item("RealVector", "Represents a vector of real values.")]
    30   public class RealVector : DoubleArray {
     31  public class RealVector : DoubleArray, ISolution {
    3132    [StorableConstructor]
    3233    protected RealVector(bool deserializing) : base(deserializing) { }
  • branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorEncoding.cs

    r12837 r13361  
    3434  [Item("RealVectorEncoding", "Describes a real vector encoding.")]
    3535  [StorableClass]
    36   public sealed class RealVectorEncoding : Encoding<IRealVectorCreator> {
     36  public sealed class RealVectorEncoding : Encoding<RealVector> {
    3737    #region Encoding Parameters
    3838    [Storable]
     
    9595    public RealVectorEncoding(string name) : this(name, 10) { }
    9696    public RealVectorEncoding(int length) : this("RealVector", length) { }
    97     public RealVectorEncoding(string name, int length, double min = double.MinValue, double max = double.MaxValue)
     97    public RealVectorEncoding(string name, int length, double min = -1000, double max = 1000)
    9898      : base(name) {
    9999      if (min >= max) throw new ArgumentException("min must be less than max", "min");
     
    318318    #endregion
    319319  }
    320 
    321   public static class IndividualExtensionMethods {
    322     public static RealVector RealVector(this Individual individual) {
    323       var encoding = individual.GetEncoding<RealVectorEncoding>();
    324       return individual.RealVector(encoding.Name);
    325     }
    326     public static RealVector RealVector(this Individual individual, string name) {
    327       return (RealVector)individual[name];
    328     }
    329   }
    330320}
Note: See TracChangeset for help on using the changeset viewer.