#region License Information /* HeuristicLab * Copyright (C) 2002-2016 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 HeuristicLab.Persistence; namespace HeuristicLab.Problems.NK { [Item("NKMoveEvaluator", "A base class for operators which evaluate moves on the NK Landscape.")] [StorableType("9ed3f828-3153-47cb-861c-eae96723de92")] 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 deserializing) : base(deserializing) { } 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")); } } }