public TuringNoveltyScorer(NoveltySearchParameters parameters)
        {
            _params  = parameters;
            _archive = new LimitedQueue <Behaviour <TGenome> >(_params.ArchiveLimit);

            _pMin              = _params.PMin;
            _generation        = 0;
            _reportInterval    = _params.ReportInterval;
            _knnTotalTimeSpent = 0;
        }
        public static NoveltySearchParameters ReadXmlProperties(XmlElement xmlConfig)
        {
            NoveltySearchParameters props = new NoveltySearchParameters();

            props.Enabled = XmlUtils.GetValueAsBool(xmlConfig, "Enabled");
            props.PMin    = XmlUtils.GetValueAsDouble(xmlConfig, "PMin");
            props.EnableArchiveComparison     = XmlUtils.TryGetValueAsBool(xmlConfig, "EnableArchiveComparison") ?? true;
            props.ArchiveLimit                = XmlUtils.GetValueAsInt(xmlConfig, "ArchiveLimit");
            props.MaxNoveltySearchGenerations = XmlUtils.GetValueAsInt(xmlConfig, "MaxNoveltySearchGenerations");
            props.PMinLowerThreshold          = XmlUtils.TryGetValueAsDouble(xmlConfig, "PMinLowerThreshold") ?? -1;
            props.ObjectiveScoreThreshold     = XmlUtils.TryGetValueAsDouble(xmlConfig, "ObjectiveScoreThreshold") ?? .9;
            props.PMinAdjustUp                = XmlUtils.GetValueAsDouble(xmlConfig, "PMinAdjustUp");
            props.PMinAdjustDown              = XmlUtils.GetValueAsDouble(xmlConfig, "PMinAdjustDown");
            props.AdditionsPMinAdjustUp       = XmlUtils.GetValueAsInt(xmlConfig, "AdditionsPMinAdjustUp");
            props.GenerationsPMinAdjustDown   = XmlUtils.GetValueAsInt(xmlConfig, "GenerationsPMinAdjustDown");
            props.K = XmlUtils.GetValueAsInt(xmlConfig, "K");
            props.ReportInterval = XmlUtils.GetValueAsInt(xmlConfig, "ReportInterval");
            props.MinimumCriteriaReadWriteLowerThreshold = XmlUtils.GetValueAsDouble(xmlConfig, "MinimumCriteriaReadWriteLowerThreshold");
            props.VectorMode = (NoveltyVectorMode)Enum.Parse(typeof(NoveltyVectorMode), XmlUtils.TryGetValueAsString(xmlConfig, "NoveltyVector") ?? "WritePattern");
            props.ObjectiveFactorExponent = XmlUtils.TryGetValueAsDouble(xmlConfig, "ObjectiveFactorExponent") ?? 0d;

            return(props);
        }
        public static NoveltySearchParameters ReadXmlProperties(XmlElement xmlConfig)
        {
            NoveltySearchParameters props = new NoveltySearchParameters();

            props.Enabled = XmlUtils.GetValueAsBool(xmlConfig, "Enabled");
            props.PMin = XmlUtils.GetValueAsDouble(xmlConfig, "PMin");
            props.EnableArchiveComparison = XmlUtils.TryGetValueAsBool(xmlConfig, "EnableArchiveComparison") ?? true;
            props.ArchiveLimit = XmlUtils.GetValueAsInt(xmlConfig, "ArchiveLimit");
            props.MaxNoveltySearchGenerations = XmlUtils.GetValueAsInt(xmlConfig, "MaxNoveltySearchGenerations");
            props.PMinLowerThreshold = XmlUtils.TryGetValueAsDouble(xmlConfig, "PMinLowerThreshold") ?? -1;
            props.ObjectiveScoreThreshold = XmlUtils.TryGetValueAsDouble(xmlConfig, "ObjectiveScoreThreshold") ?? .9;
            props.PMinAdjustUp = XmlUtils.GetValueAsDouble(xmlConfig, "PMinAdjustUp");
            props.PMinAdjustDown = XmlUtils.GetValueAsDouble(xmlConfig, "PMinAdjustDown");
            props.AdditionsPMinAdjustUp = XmlUtils.GetValueAsInt(xmlConfig, "AdditionsPMinAdjustUp");
            props.GenerationsPMinAdjustDown = XmlUtils.GetValueAsInt(xmlConfig, "GenerationsPMinAdjustDown");
            props.K = XmlUtils.GetValueAsInt(xmlConfig, "K");
            props.ReportInterval = XmlUtils.GetValueAsInt(xmlConfig, "ReportInterval");
            props.MinimumCriteriaReadWriteLowerThreshold = XmlUtils.GetValueAsDouble(xmlConfig, "MinimumCriteriaReadWriteLowerThreshold");
            props.VectorMode = (NoveltyVectorMode) Enum.Parse(typeof(NoveltyVectorMode), XmlUtils.TryGetValueAsString(xmlConfig, "NoveltyVector") ?? "WritePattern");
            props.ObjectiveFactorExponent = XmlUtils.TryGetValueAsDouble(xmlConfig, "ObjectiveFactorExponent") ?? 0d;

            return props;
        }