public string GetNameAt(StopGroup stop, DateTime time) { if (TripType.HeadsignEntries != null && TripType.HeadsignEntries.Any()) { int index = IndexAt(stop, time); string lastName = TripType.Name; foreach (var entry in TripType.HeadsignEntries) { if (entry.StartIndex > index) { break; } lastName = entry.Headsign; } return(lastName); } else { return(TripType.Name); } }
public int IndexAt(StopGroup stop, DateTime dateTime) { return(Stops.IndexOfMin(x => x.Item2.Group == stop ? dateTime.NextDateTimeAt(x.Item1) : DateTime.MaxValue)); }
public double Distance(StopGroup other) { return(Stops.Join(other.Stops, s => 0, s => 0, (s1, s2) => s1.StraightLineDistanceTo(s2)).Min()); }