Changeset 9089 for branches/LearningClassifierSystems/HeuristicLab.Encodings.CombinedIntegerVectorEncoding/3.3/CombinedIntegerVectorCreator.cs
- Timestamp:
- 12/27/12 19:14:51 (11 years ago)
- Location:
- branches/LearningClassifierSystems
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LearningClassifierSystems
-
Property
svn:ignore
set to
*.suo
-
Property
svn:ignore
set to
-
branches/LearningClassifierSystems/HeuristicLab.Encodings.CombinedIntegerVectorEncoding/3.3
-
Property
svn:ignore
set to
*.user
Plugin.cs
-
Property
svn:ignore
set to
-
branches/LearningClassifierSystems/HeuristicLab.Encodings.CombinedIntegerVectorEncoding/3.3/CombinedIntegerVectorCreator.cs
r8941 r9089 23 23 using HeuristicLab.Core; 24 24 using HeuristicLab.Data; 25 using HeuristicLab.Encodings.IntegerVectorEncoding; 25 using HeuristicLab.Operators; 26 using HeuristicLab.Optimization; 26 27 using HeuristicLab.Parameters; 27 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 33 34 [Item("CombinedIntegerVectorCreator", "A base class for operators creating combined int-valued vectors.")] 34 35 [StorableClass] 35 public abstract class CombinedIntegerVectorCreator : IntegerVectorCreator, ICombinedIntegerVectorCreator { 36 public abstract class CombinedIntegerVectorCreator : SingleSuccessorOperator, IStochasticOperator, ICombinedIntegerVectorCreator { 37 public override bool CanChangeName { 38 get { return false; } 39 } 40 public ILookupParameter<IRandom> RandomParameter { 41 get { return (LookupParameter<IRandom>)Parameters["Random"]; } 42 } 43 public IValueLookupParameter<IntValue> LengthParameter { 44 get { return (IValueLookupParameter<IntValue>)Parameters["Length"]; } 45 } 46 public IValueLookupParameter<IntMatrix> BoundsParameter { 47 get { return (IValueLookupParameter<IntMatrix>)Parameters["Bounds"]; } 48 } 49 36 50 public IValueLookupParameter<IntValue> ActionPartLengthParameter { 37 51 get { return (IValueLookupParameter<IntValue>)Parameters["ActionPartLength"]; } … … 44 58 [StorableConstructor] 45 59 protected CombinedIntegerVectorCreator(bool deserializing) : base(deserializing) { } 46 protected CombinedIntegerVectorCreator( IntegerVectorCreator original, Cloner cloner) : base(original, cloner) { }60 protected CombinedIntegerVectorCreator(CombinedIntegerVectorCreator original, Cloner cloner) : base(original, cloner) { } 47 61 protected CombinedIntegerVectorCreator() 48 62 : base() { 63 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators.")); 64 Parameters.Add(new ValueLookupParameter<IntValue>("Length", "The length of the vector.")); 65 Parameters.Add(new ValueLookupParameter<IntMatrix>("Bounds", "The bounds matrix can contain one row for each dimension with three columns specifying minimum (inclusive), maximum (exclusive), and step size. If less rows are given the matrix is cycled.")); 49 66 Parameters.Add(new LookupParameter<CombinedIntegerVector>("CombinedIntegerVector", "The vector which should be manipulated.")); 50 67 Parameters.Add(new ValueLookupParameter<IntValue>("ActionPartLength", "The length of the vector.")); 51 68 } 52 69 53 p rotected override IntegerVector Create(IRandom random, IntValue length, IntMatrix bounds) {54 CombinedIntegerVectorParameter.ActualValue = Create( random, length, bounds, ActionPartLengthParameter.ActualValue);55 return CombinedIntegerVectorParameter.ActualValue;70 public sealed override IOperation Apply() { 71 CombinedIntegerVectorParameter.ActualValue = Create(RandomParameter.ActualValue, LengthParameter.ActualValue, BoundsParameter.ActualValue, ActionPartLengthParameter.ActualValue); 72 return base.Apply(); 56 73 } 57 74
Note: See TracChangeset
for help on using the changeset viewer.