# sorting is important: because the original station list is sorted, a sorted tabList makes sure that no slot is overwritten before it is needed (data is always generated before or at the slot of the source station)
deffindTabStation(s):
allTabs.sort()
fornr,tabinenumerate(tiedArrayStationList):
forstintab.split('+'):
ifs.getName()==st:
returnnr
tabList=map(findTabStation,self.stations)
deffindTabStation(st):
fornr,tabinenumerate(allTabs):
ifstintab:
returnnr
tabList=map(findTabStation,allStationNames)
# make sure this tabList can be processed by going from element 0 to n-1 (dest slot is always at or after source slot)
forst,nrinenumerate(tabList):
assertst>=nr,"Station %s is at position %u in the station list but at position %u in the tab list, which could lead to data corruption"%(allStationNames[st],st,nr)