Last change
on this file since 3580 was
3415,
checked in by mkofler, 15 years ago
|
Worked on particle swarm optimization algorithm #852 (WIP)
|
File size:
1.2 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using HeuristicLab.Encodings.RealVectorEncoding;
|
---|
6 | using HeuristicLab.Operators;
|
---|
7 | using HeuristicLab.Core;
|
---|
8 | using HeuristicLab.Parameters;
|
---|
9 |
|
---|
10 | namespace 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.