Exemplo n.º 1
0
def readSimFCDComplete(fcdPath):
    """Reads the FCD-File and creates a list of Id's with a belonging List of Data tuples. Uses the given taxiIds."""
    #reset all
    global taxis, routes, vlsEdges, taxiIdDict, fcdDict
    taxis=[]
    routes=[]
    vlsEdges=[]
    taxiIdDict={} 
    fcdDict={}   
    
    inputFile=open(fcdPath,'r')
    for line in inputFile:
        words= line.split("\t")
        #add route
        taxiId=getSimTaxiId(words[4])               
        if taxiId in taxis:
            fcdDict[taxiId].append((getTimeInSecs(getNiceTimeLabel(words[0])),words[1],words[2]))                       
        else: 
            taxis.append(taxiId)            
            fcdDict[taxiId]=[(getTimeInSecs(getNiceTimeLabel(words[0])),words[1],words[2])]           
    inputFile.close()
    return fcdDict    
Exemplo n.º 2
0
def readSimFCDComplete(fcdPath):
    """Reads the FCD-File and creates a list of Id's with a belonging List of Data tuples. Uses the given taxiIds."""
    #reset all
    global taxis, routes, vlsEdges, taxiIdDict, fcdDict
    taxis=[]
    routes=[]
    vlsEdges=[]
    taxiIdDict={} 
    fcdDict={}   
    
    inputFile=open(fcdPath,'r')
    for line in inputFile:
        words= line.split("\t")
        #add route
        taxiId=getSimTaxiId(words[4])               
        if taxiId in taxis:
            fcdDict[taxiId].append((getTimeInSecs(getNiceTimeLabel(words[0])),words[1],words[2]))                       
        else: 
            taxis.append(taxiId)            
            fcdDict[taxiId]=[(getTimeInSecs(getNiceTimeLabel(words[0])),words[1],words[2])]           
    inputFile.close()
    return fcdDict