227 for bus_stop in other.stops: |
227 for bus_stop in other.stops: |
228 bus_stop.cluster = self |
228 bus_stop.cluster = self |
229 self.stops |= other.stops |
229 self.stops |= other.stops |
230 other.stops = set() |
230 other.stops = set() |
231 other.cached_center = None |
231 other.cached_center = None |
232 def schedule(self, *, max_amount = 50): |
232 def schedule(self, *, max_amount = 50, max_past = 0, arrivals = False): |
233 result = [] |
233 result = [] |
234 for stop in self.stops: |
234 for stop in self.stops: |
235 result += stop.schedule(max_amount = max_amount) |
235 result += stop.schedule(max_amount = max_amount, max_past = max_past, arrivals = arrivals) |
236 result.sort(key = lambda schedule_entry: schedule_entry['time']) |
236 result.sort(key = lambda schedule_entry: schedule_entry['time']) |
237 return result[:max_amount] |
237 return result[:max_amount] |
238 def __lt__(self, other): |
238 def __lt__(self, other): |
239 return (self.name and other.name) and (self.name < other.name) or (id(self) < id(other)) |
239 return (self.name and other.name) and (self.name < other.name) or (id(self) < id(other)) |
240 |
240 |