Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/RealVectorToRealVectorEncoder.cs @ 3438

Last change on this file since 3438 was 3415, checked in by mkofler, 14 years ago

Worked on particle swarm optimization algorithm #852 (WIP)

File size: 1.2 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using HeuristicLab.Encodings.RealVectorEncoding;
6using HeuristicLab.Operators;
7using HeuristicLab.Core;
8using HeuristicLab.Parameters;
9
10namespace HeuristicLab.Algorithms.ParticleSwarmOptimization {
11  public class RealVectorToRealVectorEncoder : SingleSuccessorOperator, IRealVectorEncoder {
12    public ILookupParameter<RealVector> RealVectorParameter {
13      get { return (ILookupParameter<RealVector>)Parameters["RealVector"]; }
14    }
15
16    public ILookupParameter<RealVector> RealVector2Parameter {
17      get { return (ILookupParameter<RealVector>)Parameters["RealVector2"]; }
18    }
19
20    public RealVectorToRealVectorEncoder()
21      : base() {
22      Parameters.Add(new LookupParameter<RealVector>("RealVector", "The original real vecor."));
23      Parameters.Add(new LookupParameter<RealVector>("RealVector2", "The resulting real vector (linked)."));
24    }
25
26    public override IOperation Apply() {
27      RealVector realVector = RealVectorParameter.ActualValue;
28
29      RealVector realVector2 = realVector; // only reference
30      return base.Apply();
31    }
32
33    public override bool CanChangeName {
34      get { return false; }
35    }
36  }
37}
Note: See TracBrowser for help on using the repository browser.