Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/06/10 19:06:26 (14 years ago)
Author:
mkofler
Message:

Worked on #852 (PSO)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/PermutationToRealVectorEncoder.cs

    r3376 r3682  
    1111using HeuristicLab.Encodings.RealVectorEncoding;
    1212using HeuristicLab.Collections;
     13using HeuristicLab.Optimization;
    1314
    1415namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
    15   public class PermutationToRealVectorEncoder : SingleSuccessorOperator, IRealVectorEncoder, IPermutationManipulator {
     16  public class PermutationToRealVectorEncoder : SingleSuccessorOperator, IRealVectorEncoder {
    1617
    17     public ILookupParameter<RealVector> RealVectorParameter {
    18       get { return (ILookupParameter<RealVector>)Parameters["RealVector"]; }
     18    public IParameter RealVectorParameter {
     19      get { return (IParameter)Parameters["RealVector"]; }
    1920    }
    2021
     
    2324    }
    2425
     26    public ILookupParameter<IntValue> LengthParameter {
     27      get { return (ILookupParameter<IntValue>)Parameters["Length"]; }
     28    }
     29
    2530    public PermutationToRealVectorEncoder() : base() {
    2631      Parameters.Add(new LookupParameter<Permutation>("Permutation", "The permutation to encode."));
    2732      Parameters.Add(new LookupParameter<RealVector>("RealVector", "The resulting real vector."));
     33      Parameters.Add(new LookupParameter<IntValue>("Length", "Vector length."));
    2834    }
    2935
     
    3743        max = max - 1;
    3844      }
    39       RealVectorParameter.ActualValue = realVector;
     45      RealVectorParameter.ActualValue = realVector;
     46      LengthParameter.ActualValue = new IntValue(realVector.Length);
    4047      return base.Apply();
    4148    }
Note: See TracChangeset for help on using the changeset viewer.