Free cookie consent management tool by TermsFeed Policy Generator

source: branches/SimSharp/HeuristicLab.Problems.Programmable/3.3/Operators/ParameterVectorManipulator.cs @ 10753

Last change on this file since 10753 was 10753, checked in by abeham, 11 years ago

#2174: The problem is now not Sim# specific anymore, but the parameters of Sim# models could be optimized using this problem. It's all about being able to program the evaluation function and parameter vector.

File size: 3.0 KB
Line 
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
22using HeuristicLab.Common;
23using HeuristicLab.Core;
24using HeuristicLab.Encodings.BinaryVectorEncoding;
25using HeuristicLab.Encodings.IntegerVectorEncoding;
26using HeuristicLab.Encodings.PermutationEncoding;
27using HeuristicLab.Encodings.RealVectorEncoding;
28using HeuristicLab.Operators;
29using HeuristicLab.Optimization;
30using HeuristicLab.Parameters;
31using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
32
33namespace 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}
Note: See TracBrowser for help on using the repository browser.