public void RunSynchronous(PiecewiseLinearSpeedProfileOptimizationSettings optimizationSettings,
                                   Random randomNumberGenerator, double optimizationTime, MetricMap metricMap, MetricPath metricPath)
        {
            this.optimizationTime      = optimizationTime;
            this.optimizationSettings  = optimizationSettings;
            this.metricMap             = metricMap;
            this.metricPath            = metricPath;
            this.randomNumberGenerator = randomNumberGenerator;

            stopWatch = new Stopwatch();
            OptimizationLoop();
        }
        public void Run(PiecewiseLinearSpeedProfileOptimizationSettings optimizationSettings,
                        Random randomNumberGenerator, double optimizationTime, MetricMap metricMap, MetricPath metricPath)
        {
            this.optimizationTime      = optimizationTime;
            this.optimizationSettings  = optimizationSettings;
            this.metricMap             = metricMap;
            this.metricPath            = metricPath;
            this.randomNumberGenerator = randomNumberGenerator;

            stopWatch          = new Stopwatch();
            optimizationThread = new Thread(new ThreadStart(OptimizationLoop));
            optimizationThread.Start();
        }