Changeset 3059 for trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorCreator.cs
- Timestamp:
- 03/16/10 10:35:28 (14 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorCreator.cs
r3054 r3059 31 31 /// A base class for operators creating int-valued vectors. 32 32 /// </summary> 33 [Item("Int VectorCreator", "A base class for operators creating int-valued vectors.")]33 [Item("IntegerVectorCreator", "A base class for operators creating int-valued vectors.")] 34 34 [StorableClass] 35 public abstract class Int VectorCreator : SingleSuccessorOperator, IIntVectorCreator, IStochasticOperator {35 public abstract class IntegerVectorCreator : SingleSuccessorOperator, IIntegerVectorCreator, IStochasticOperator { 36 36 public ILookupParameter<IRandom> RandomParameter { 37 37 get { return (LookupParameter<IRandom>)Parameters["Random"]; } 38 38 } 39 public ILookupParameter<Int Array> IntVectorParameter {40 get { return (ILookupParameter<Int Array>)Parameters["IntVector"]; }39 public ILookupParameter<IntegerVector> IntegerVectorParameter { 40 get { return (ILookupParameter<IntegerVector>)Parameters["IntegerVector"]; } 41 41 } 42 42 public IValueLookupParameter<IntValue> LengthParameter { … … 50 50 } 51 51 52 protected Int VectorCreator()52 protected IntegerVectorCreator() 53 53 : base() { 54 54 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators.")); 55 Parameters.Add(new LookupParameter<Int Array>("IntVector", "The vector which should be manipulated."));55 Parameters.Add(new LookupParameter<IntegerVector>("IntegerVector", "The vector which should be manipulated.")); 56 56 Parameters.Add(new ValueLookupParameter<IntValue>("Length", "The length of the vector.")); 57 57 Parameters.Add(new ValueLookupParameter<IntValue>("Minimum", "The lower bound for each element in the vector.")); … … 60 60 61 61 public sealed override IOperation Apply() { 62 Int VectorParameter.ActualValue = Create(RandomParameter.ActualValue, LengthParameter.ActualValue, MinimumParameter.ActualValue, MaximumParameter.ActualValue);62 IntegerVectorParameter.ActualValue = Create(RandomParameter.ActualValue, LengthParameter.ActualValue, MinimumParameter.ActualValue, MaximumParameter.ActualValue); 63 63 return base.Apply(); 64 64 } 65 65 66 protected abstract Int ArrayCreate(IRandom random, IntValue length, IntValue minimum, IntValue maximum);66 protected abstract IntegerVector Create(IRandom random, IntValue length, IntValue minimum, IntValue maximum); 67 67 } 68 68 }
Note: See TracChangeset
for help on using the changeset viewer.