1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
4 | *
|
---|
5 | * This file is part of HeuristicLab.
|
---|
6 | *
|
---|
7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
8 | * it under the terms of the GNU General Public License as published by
|
---|
9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
10 | * (at your option) any later version.
|
---|
11 | *
|
---|
12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | * GNU General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU General Public License
|
---|
18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
19 | */
|
---|
20 | #endregion
|
---|
21 |
|
---|
22 | using HeuristicLab.Common;
|
---|
23 | using HeuristicLab.Core;
|
---|
24 | using HeuristicLab.Encodings.BinaryVectorEncoding;
|
---|
25 | using HeuristicLab.Encodings.IntegerVectorEncoding;
|
---|
26 | using HeuristicLab.Encodings.PermutationEncoding;
|
---|
27 | using HeuristicLab.Encodings.RealVectorEncoding;
|
---|
28 | using HeuristicLab.Operators;
|
---|
29 | using HeuristicLab.Optimization;
|
---|
30 | using HeuristicLab.Parameters;
|
---|
31 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
32 |
|
---|
33 | namespace HeuristicLab.Problems.Programmable {
|
---|
34 | [Item("ParameterVector Manipulator", "Applies different manipulators to change a parameter vector.")]
|
---|
35 | [StorableClass]
|
---|
36 | public class ParameterVectorManipulator : InstrumentedOperator, IManipulator {
|
---|
37 | public ILookupParameter<BinaryVector> BinaryVectorParameter {
|
---|
38 | get { return (ILookupParameter<BinaryVector>)Parameters["BinaryVector"]; }
|
---|
39 | }
|
---|
40 |
|
---|
41 | public ILookupParameter<IntegerVector> IntegerVectorParameter {
|
---|
42 | get { return (ILookupParameter<IntegerVector>)Parameters["IntegerVector"]; }
|
---|
43 | }
|
---|
44 |
|
---|
45 | public ILookupParameter<RealVector> RealVectorParameter {
|
---|
46 | get { return (ILookupParameter<RealVector>)Parameters["RealVector"]; }
|
---|
47 | }
|
---|
48 |
|
---|
49 | public ILookupParameter<Permutation> PermutationParameter {
|
---|
50 | get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; }
|
---|
51 | }
|
---|
52 |
|
---|
53 | [StorableConstructor]
|
---|
54 | protected ParameterVectorManipulator(bool deserializing) : base(deserializing) { }
|
---|
55 | protected ParameterVectorManipulator(ParameterVectorManipulator original, Cloner cloner)
|
---|
56 | : base(original, cloner) { }
|
---|
57 | public ParameterVectorManipulator() {
|
---|
58 | Parameters.Add(new LookupParameter<BinaryVector>("BinaryVector", "The binary vector that links into the parameter vector."));
|
---|
59 | Parameters.Add(new LookupParameter<IntegerVector>("IntegerVector", "The integer vector that links into the parameter vector."));
|
---|
60 | Parameters.Add(new LookupParameter<RealVector>("RealVector", "The real vector that links into the parameter vector."));
|
---|
61 | Parameters.Add(new LookupParameter<Permutation>("Permutation", "The permutation that links into the parameter vector."));
|
---|
62 | }
|
---|
63 |
|
---|
64 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
65 | return new ParameterVectorManipulator(this, cloner);
|
---|
66 | }
|
---|
67 | }
|
---|
68 | }
|
---|