#region License Information /* HeuristicLab * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using HeuristicLab.Common; using HeuristicLab.Core; using HeuristicLab.Data; using HeuristicLab.Encodings.BinaryVectorEncoding; using HeuristicLab.Operators; using HeuristicLab.Parameters; using HEAL.Attic; namespace HeuristicLab.Problems.NK { [Item("NKMoveEvaluator", "A base class for operators which evaluate moves on the NK Landscape.")] [StorableType("54E33987-5AC1-4E3B-ABE7-769B009A6A76")] public abstract class NKMoveEvaluator : SingleSuccessorOperator, INKMoveEvaluator, IBinaryVectorMoveOperator { public ILookupParameter QualityParameter { get { return (ILookupParameter)Parameters["Quality"]; } } public ILookupParameter MoveQualityParameter { get { return (ILookupParameter)Parameters["MoveQuality"]; } } public ILookupParameter BinaryVectorParameter { get { return (ILookupParameter)Parameters["BinaryVector"]; } } public ILookupParameter GeneInteractionsParameter { get { return (ILookupParameter)Parameters["GeneInteractions"]; } } public ILookupParameter InteractionSeedParameter { get { return (ILookupParameter)Parameters["InteractionSeed"]; } } public ILookupParameter WeightsParameter { get { return (ILookupParameter)Parameters["Weights"]; } } public ILookupParameter QParameter { get { return (ILookupParameter)Parameters["Q"]; } } public ILookupParameter PParameter { get { return (ILookupParameter)Parameters["P"]; } } [StorableConstructor] protected NKMoveEvaluator(StorableConstructorFlag _) : base(_) { } protected NKMoveEvaluator(NKMoveEvaluator original, Cloner cloner) : base(original, cloner) { } protected NKMoveEvaluator() : base() { Parameters.Add(new LookupParameter("Quality", "The quality of a OneMax solution.")); Parameters.Add(new LookupParameter("MoveQuality", "The evaluated quality of a move on a OneMax solution.")); Parameters.Add(new LookupParameter("BinaryVector", "The solution as BinaryVector.")); Parameters.Add(new LookupParameter("GeneInteractions", "Matrix indicating gene interactions.")); Parameters.Add(new LookupParameter("InteractionSeed", "Seed used for randomly generting gene interactions.")); Parameters.Add(new LookupParameter("Weights", "The weights for the component functions. If shorter, will be repeated.")); Parameters.Add(new LookupParameter("Q", "Number of allowed fitness values in the (virutal) random table, or zero")); Parameters.Add(new LookupParameter("P", "Probability of any entry in the (virtual) random table being zero")); } } }