Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/19/10 15:59:37 (14 years ago)
Author:
abeham
Message:

Updated RealVector encoding to use a double matrix as bounds #929

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorCreator.cs

    r3060 r3123  
    4747      get { return (IValueLookupParameter<IntValue>)Parameters["Length"]; }
    4848    }
    49     public IValueLookupParameter<DoubleValue> MinimumParameter {
    50       get { return (IValueLookupParameter<DoubleValue>)Parameters["Minimum"]; }
    51     }
    52     public IValueLookupParameter<DoubleValue> MaximumParameter {
    53       get { return (IValueLookupParameter<DoubleValue>)Parameters["Maximum"]; }
     49    public IValueLookupParameter<DoubleMatrix> BoundsParameter {
     50      get { return (IValueLookupParameter<DoubleMatrix>)Parameters["Bounds"]; }
    5451    }
    5552
     
    5956      Parameters.Add(new LookupParameter<RealVector>("RealVector", "The vector which should be manipulated."));
    6057      Parameters.Add(new ValueLookupParameter<IntValue>("Length", "The length of the vector."));
    61       Parameters.Add(new ValueLookupParameter<DoubleValue>("Minimum", "The lower bound for each element in the vector."));
    62       Parameters.Add(new ValueLookupParameter<DoubleValue>("Maximum", "The upper bound for each element in the vector."));
     58      Parameters.Add(new ValueLookupParameter<DoubleMatrix>("Bounds", "A 2 column matrix specifying the lower and upper bound for each dimension. If there are less rows than dimension the bounds vector is cycled."));
    6359    }
    6460
    6561    public sealed override IOperation Apply() {
    66       RealVectorParameter.ActualValue = Create(RandomParameter.ActualValue, LengthParameter.ActualValue, MinimumParameter.ActualValue, MaximumParameter.ActualValue);
     62      RealVectorParameter.ActualValue = Create(RandomParameter.ActualValue, LengthParameter.ActualValue, BoundsParameter.ActualValue);
    6763      return base.Apply();
    6864    }
    6965
    70     protected abstract RealVector Create(IRandom random, IntValue length, DoubleValue minimum, DoubleValue maximum);
     66    protected abstract RealVector Create(IRandom random, IntValue length, DoubleMatrix bounds);
    7167  }
    7268}
Note: See TracChangeset for help on using the changeset viewer.