1 | using HeuristicLab.Common;
|
---|
2 | using HeuristicLab.Core;
|
---|
3 | using HeuristicLab.Data;
|
---|
4 | using HeuristicLab.Encodings.BinaryVectorEncoding;
|
---|
5 | using HeuristicLab.Operators;
|
---|
6 | using HeuristicLab.Optimization;
|
---|
7 | using HeuristicLab.Parameters;
|
---|
8 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
9 |
|
---|
10 | namespace HeuristicLab.Problems.NK {
|
---|
11 |
|
---|
12 | [Item("NKMoveEvaluator", "A base class for operators which evaluate moves on the NK Lanscape.")]
|
---|
13 | [StorableClass]
|
---|
14 | public abstract class NKMoveEvaluator : SingleSuccessorOperator, INKMoveEvaluator, IMoveOperator, IBinaryVectorMoveOperator {
|
---|
15 |
|
---|
16 | public ILookupParameter<DoubleValue> QualityParameter {
|
---|
17 | get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
|
---|
18 | }
|
---|
19 | public ILookupParameter<DoubleValue> MoveQualityParameter {
|
---|
20 | get { return (ILookupParameter<DoubleValue>)Parameters["MoveQuality"]; }
|
---|
21 | }
|
---|
22 | public ILookupParameter<BinaryVector> BinaryVectorParameter {
|
---|
23 | get { return (ILookupParameter<BinaryVector>)Parameters["BinaryVector"]; }
|
---|
24 | }
|
---|
25 | public LookupParameter<BoolMatrix> GeneInteractionsParameter {
|
---|
26 | get { return (LookupParameter<BoolMatrix>)Parameters["GeneInteractions"]; }
|
---|
27 | }
|
---|
28 | public LookupParameter<IntValue> InteractionSeedParameter {
|
---|
29 | get { return (LookupParameter<IntValue>)Parameters["InteractionSeed"]; }
|
---|
30 | }
|
---|
31 | public LookupParameter<DoubleArray> WeightsParameter {
|
---|
32 | get { return (LookupParameter<DoubleArray>)Parameters["Weights"]; }
|
---|
33 | }
|
---|
34 |
|
---|
35 | [StorableConstructor]
|
---|
36 | protected NKMoveEvaluator(bool deserializing) : base(deserializing) { }
|
---|
37 | protected NKMoveEvaluator(NKMoveEvaluator original, Cloner cloner) : base(original, cloner) { }
|
---|
38 | protected NKMoveEvaluator()
|
---|
39 | : base() {
|
---|
40 | Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of a OneMax solution."));
|
---|
41 | Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The evaluated quality of a move on a OneMax solution."));
|
---|
42 | Parameters.Add(new LookupParameter<BinaryVector>("BinaryVector", "The solution as BinaryVector."));
|
---|
43 | Parameters.Add(new LookupParameter<BoolMatrix>("GeneInteractions", "Matrix indicating gene interactions."));
|
---|
44 | Parameters.Add(new LookupParameter<IntValue>("InteractionSeed", "Seed used for randomly generting gene interactions."));
|
---|
45 | Parameters.Add(new LookupParameter<DoubleArray>("Weights", "The weights for the component functions. If shorter, will be repeated."));
|
---|
46 | }
|
---|
47 | }
|
---|
48 | }
|
---|