public static void Calculate(string variableName, int mode, int pathType, double vot, int minute)
        {
            SamplingWeightsCalculator samplingWeightsCalculator = new SamplingWeightsCalculator(variableName, mode, pathType, vot, minute);
            int segmentCount = samplingWeightsCalculator._segmentCount;

            Global.SegmentZones = new SegmentZone[segmentCount][];

            Parallel.For(0, segmentCount, new ParallelOptions {
                MaxDegreeOfParallelism = ParallelUtility.NThreads
            }, segment => CalculateSegment(samplingWeightsCalculator, segment));
        }
        private static void CalculateSegment(SamplingWeightsCalculator samplingWeightsCalculator, int segment)
        {
            FileInfo file = new FileInfo(string.Format(Global.SamplingWeightsPath, segment));

            //if (Global.Configuration.ShouldLoadSamplingWeightsFromFile && file.Exists) {
            //  Global.SegmentZones[segment] = LoadSamplingWeightsFromFile(file);

            //  return;
            //}

            Global.SegmentZones[segment] = samplingWeightsCalculator.ComputeSegment(segment);

            //if (Global.Configuration.ShouldLoadSamplingWeightsFromFile && !file.Exists) {
            //  SaveSamplingWeightsToFile(file, segment);
            //}
        }