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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.