/** add times from scheduleData to the existing data for averaging */ public void AddTimes(VehicleScheduleData scheduleData) { foreach ((RootTask endStationTask, VehicleStationLocation startStation, VehicleStationLocation endStation, List <VehicleStationLocation> nonstopStations) in scheduleData.GetNonNonstopScheduleParts()) { TimeSpan?duration = scheduleData.GetAverageTravelDuration(endStationTask); if (duration != null) { DurationDataSet travelTime = GetOrAddTravelTimeSet(startStation, endStation, nonstopStations); travelTime.Add(duration.Value); } TimeSpan?stationDuration = scheduleData.GetAverageStationLoadingDuration(endStationTask); if (stationDuration != null) { DurationDataSet stationTimeSet = GetOrAddStationTimeSet(endStation); stationTimeSet.Add(stationDuration.Value); } } }
public void Add(RootTask task, TimeSpan duration) { DurationDataSet dataSet = GetOrCreateDataSetForTask(task); dataSet.Add(duration); }