Changeset 3682 for trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/PermutationToRealVectorEncoder.cs
- Timestamp:
- 05/06/10 19:06:26 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/PermutationToRealVectorEncoder.cs
r3376 r3682 11 11 using HeuristicLab.Encodings.RealVectorEncoding; 12 12 using HeuristicLab.Collections; 13 using HeuristicLab.Optimization; 13 14 14 15 namespace HeuristicLab.Algorithms.ParticleSwarmOptimization { 15 public class PermutationToRealVectorEncoder : SingleSuccessorOperator, IRealVectorEncoder , IPermutationManipulator{16 public class PermutationToRealVectorEncoder : SingleSuccessorOperator, IRealVectorEncoder { 16 17 17 public I LookupParameter<RealVector>RealVectorParameter {18 get { return (I LookupParameter<RealVector>)Parameters["RealVector"]; }18 public IParameter RealVectorParameter { 19 get { return (IParameter)Parameters["RealVector"]; } 19 20 } 20 21 … … 23 24 } 24 25 26 public ILookupParameter<IntValue> LengthParameter { 27 get { return (ILookupParameter<IntValue>)Parameters["Length"]; } 28 } 29 25 30 public PermutationToRealVectorEncoder() : base() { 26 31 Parameters.Add(new LookupParameter<Permutation>("Permutation", "The permutation to encode.")); 27 32 Parameters.Add(new LookupParameter<RealVector>("RealVector", "The resulting real vector.")); 33 Parameters.Add(new LookupParameter<IntValue>("Length", "Vector length.")); 28 34 } 29 35 … … 37 43 max = max - 1; 38 44 } 39 RealVectorParameter.ActualValue = realVector; 45 RealVectorParameter.ActualValue = realVector; 46 LengthParameter.ActualValue = new IntValue(realVector.Length); 40 47 return base.Apply(); 41 48 }
Note: See TracChangeset
for help on using the changeset viewer.