#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 potentially
namespace HeuristicLab.Algorithms.EvolvmentModelsOfModels {
[StorableType("AB38211D-5F52-4420-A606-1C3CB58BA27C")]
public interface IEMMSolution : IItem {
IItem Individual { get; set; }
DoubleValue Qualities { get; set; }
}
[Item("EMMSolution", "Represents a solution inside the EMM population")]
[StorableType("C0E63430-5000-4592-BBE4-2D3E0EE1AE3F")]
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(IScope scope) {
Individual = scope;
Qualities = (DoubleValue)scope.Variables["Quality"].Value;
}
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 = cloner.Clone(original.Qualities);
Individual = cloner.Clone(original.Individual);
}
[StorableConstructor]
protected EMMSolution(StorableConstructorFlag _) : base(_) { }
}
[Item("EMMSolution", "Represents a solution inside the EMM population")]
[StorableType("559EA31B-2263-4233-900C-EC62120EE580")]
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(_) { }
}
}