public void TrackConvergenceBehaviorThrowsForMissingRunEvaluator() { var incumbentWrapper = new IncumbentGenomeWrapper <TestResult> { IncumbentGeneration = 0, IncumbentGenome = new Genome(), IncumbentInstanceResults = new List <TestResult>().ToImmutableList(), }; Assert.Throws <ArgumentNullException>(() => RunStatisticTracker.TrackConvergenceBehavior(incumbentWrapper, runEvaluator: null)); }
/// <summary> /// Tracks the convergence behavior of the algorithm and logs it to csv. /// </summary> private void TrackConvergenceBehavior() { var metricRunEvaluator = this._runEvaluator as IMetricRunEvaluator <TResult>; if (metricRunEvaluator == null || !this._configuration.TrackConvergenceBehavior) { return; } var currentAverage = RunStatisticTracker.TrackConvergenceBehavior(this._incumbentGenomeWrapper, metricRunEvaluator); this.IncumbentQuality.Add(currentAverage); }