#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 HEAL.Attic; using HeuristicLab.Common; using HeuristicLab.Core; using DoubleValue = HeuristicLab.Data.DoubleValue; // Can be deleted potnetinaly namespace HeuristicLab.Algorithms.EvolvmentModelsOfModels { public interface IEMMSolution : IItem { IItem Individual { get; set; } DoubleValue Qualities { get; set; } } [Item("EMMSolution", "Represents a solution inside the EMM population")] [StorableType("708BDF29-AD3F-4AFC-83AE-551A27FF45A0")] public class EMMSolution : Item, IEMMSolution { [Storable] public IItem Individual { get; set; } [Storable] public DoubleValue Qualities { get; set; } public EMMSolution() { } public EMMSolution(IItem individual) : this() { Individual = individual; } public EMMSolution(IItem individual, DoubleValue qualities) { Individual = individual; Qualities = qualities; } public EMMSolution(DoubleValue qualities) { Qualities = qualities; } public int Dimensions = 1; public override IDeepCloneable Clone(Cloner cloner) { return new EMMSolution(this, cloner); } protected EMMSolution(EMMSolution original, Cloner cloner) : base(original, cloner) { Qualities = original.Qualities; Individual = (IItem)original.Individual.Clone(cloner); } [StorableConstructor] protected EMMSolution(StorableConstructorFlag _) : base(_) { } } [Item("EMMSolution", "Represents a solution inside the EMM population")] [StorableType("36929CD1-63A5-4270-8C65-2A8177BCA0AE")] public class EMMSolution : EMMSolution where T : class, IItem { public new T Individual { get { return (T)base.Individual; } set { base.Individual = value; } } public EMMSolution(T individual) : base(individual) { } protected EMMSolution(EMMSolution original, Cloner cloner) : base(original, cloner) { } public override IDeepCloneable Clone(Cloner cloner) { return new EMMSolution(this, cloner); } [StorableConstructor] protected EMMSolution(StorableConstructorFlag _) : base(_) { } } }