private float CalculateDATTime(Time time, IZone originalZone, int accessFlat, IZone destinationZone, bool access) { var origin = ZoneSystem.GetFlatIndex(originalZone.ZoneNumber); var destination = ZoneSystem.GetFlatIndex(destinationZone.ZoneNumber); if (access) { return((AutoNetwork.TravelTime(origin, accessFlat, time) + TransitNetwork.TravelTime(accessFlat, destination, time)).ToMinutes()); } else { return((TransitNetwork.TravelTime(origin, accessFlat, time) + AutoNetwork.TravelTime(accessFlat, destination, time)).ToMinutes()); } }
private float CalculateDATTime(SparseArray <IZone> _zoneSystem, INetworkData _autoNetwork, ITripComponentData _transitNetwork, Time time, IZone originalZone, int accessFlat, IZone destinationZone, bool access) { var origin = _zoneSystem.GetFlatIndex(originalZone.ZoneNumber); var destination = _zoneSystem.GetFlatIndex(destinationZone.ZoneNumber); if (access) { return((_autoNetwork.TravelTime(origin, accessFlat, time) + _transitNetwork.TravelTime(accessFlat, destination, time)).ToMinutes()); } else { return((_transitNetwork.TravelTime(origin, accessFlat, time) + _autoNetwork.TravelTime(accessFlat, destination, time)).ToMinutes()); } }
/// <summary> /// Gets the minimum amount of Travel Time for /// a Transit Egress by finding the Station /// with the lowest travel time /// </summary> /// <param name="origin">The start zone</param> /// <param name="destination">The end zone</param> /// <param name="time">The time period = 0</param> /// <returns>The lowest travel time among closest stations</returns> public Time TravelTime(IZone origin, IZone destination, Time time) { int[] egressStations = TransitAccessData.ClosestStations(origin); Time minTravelTime = Time.EndOfDay; var auto = TashaRuntime.AutoMode; for (int i = 0; i < egressStations.Length; i++) { var station = TashaRuntime.ZoneSystem.Get(egressStations[i]); Time travelTime = auto.TravelTime(destination, station, time) + TransitAccessData.TravelTime(station, origin, time); if (travelTime < minTravelTime) { minTravelTime = travelTime; } } return(minTravelTime); }
public Time TravelTime(IZone origin, IZone destination, Time time) { return(Network.TravelTime(origin, destination, time)); }
public Time TravelTime(IZone origin, IZone destination, Time time) { CheckInterchangeZone(); return(First.TravelTime(origin, InterchangeZone, time) + Second.TravelTime(InterchangeZone, destination, time)); }