#region License Information /* HeuristicLab * Copyright (C) 2002-2012 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.Persistence.Default.CompositeSerializers.Storable; namespace HeuristicLab.Encodings.ConditionActionEncoding { [Item("XCSClassifier", "Represents a single XCS classifier")] [StorableClass] public class XCSClassifier : Item { #region private variables [Storable] private IClassifier classifier; [Storable] private DoubleValue prediction; [Storable] private DoubleValue predictionError; [Storable] private DoubleValue fitness; [Storable] private IntValue experience; [Storable] private IntValue timestamp; [Storable] private DoubleValue averageActionSetSize; [Storable] private IntValue numerosity; #endregion #region properties public IClassifier Classifier { get { return classifier; } set { classifier = value; } } public DoubleValue Prediction { get { return prediction; } set { prediction = value; } } public DoubleValue PredictionError { get { return predictionError; } set { predictionError = value; } } public DoubleValue Fitness { get { return fitness; } set { fitness = value; } } public IntValue Experience { get { return experience; } set { experience = value; } } public IntValue Timestamp { get { return timestamp; } set { timestamp = value; } } public DoubleValue AverageActionSetSize { get { return averageActionSetSize; } set { averageActionSetSize = value; } } public IntValue Numerosity { get { return numerosity; } set { numerosity = value; } } #endregion [StorableConstructor] protected XCSClassifier(bool deserializing) : base(deserializing) { } protected XCSClassifier(XCSClassifier original, Cloner cloner) : base(original, cloner) { classifier = cloner.Clone(original.classifier); prediction = cloner.Clone(original.prediction); predictionError = cloner.Clone(original.predictionError); fitness = cloner.Clone(original.fitness); experience = cloner.Clone(original.experience); timestamp = cloner.Clone(original.timestamp); averageActionSetSize = cloner.Clone(original.averageActionSetSize); numerosity = cloner.Clone(original.numerosity); } public override IDeepCloneable Clone(Cloner cloner) { return new XCSClassifier(this, cloner); } public XCSClassifier() : base() { } public XCSClassifier(IClassifier classifier, DoubleValue prediction, DoubleValue predictionError, DoubleValue fitness, IntValue experience, IntValue timestamp, DoubleValue averageActionSetSize, IntValue numerosity) { this.classifier = classifier; this.prediction = prediction; this.predictionError = predictionError; this.fitness = fitness; this.experience = experience; this.timestamp = timestamp; this.averageActionSetSize = averageActionSetSize; this.numerosity = numerosity; } } }