/// <summary>
        /// Collects the result and updates <see cref="Max"/>, <see cref="Min"/> dictionaries.
        /// </summary>
        /// <param name="simulation">Simulation of the result.</param>
        /// <param name="result">Result value.</param>
        public void Collect(Simulation simulation, double result)
        {
            if (simulation == null)
            {
                throw new ArgumentNullException(nameof(simulation));
            }

            lock (_locker)
            {
                if (Min.ContainsKey(simulation))
                {
                    Min[simulation] = Math.Min(Min[simulation], result);
                }
                else
                {
                    Min[simulation] = result;
                }

                if (Max.ContainsKey(simulation))
                {
                    Max[simulation] = Math.Max(Max[simulation], result);
                }
                else
                {
                    Max[simulation] = result;
                }
            }
        }