コード例 #1
0
ファイル: assign.py プロジェクト: behrisch/sumo
def assignVeh(verbose, vehicles, startVertex, endVertex, edges, AssignedVeh, AssignedTrip, vehID):
    while AssignedVeh[startVertex][endVertex] < int(round(AssignedTrip[startVertex][endVertex])):
        vehID += 1
        newVehicle = Vehicle(str(vehID))
        newVehicle.route = edges
        vehicles.append(newVehicle)

        AssignedVeh[startVertex][endVertex] += 1
    if verbose:
        print('vehID:', vehID)
        print('AssignedTrip[start][end]', AssignedTrip[startVertex][endVertex])
        print('AssignedVeh[start][end]', AssignedVeh[startVertex][endVertex])

    return vehID
コード例 #2
0
def assignVeh(verbose, vehicles, startVertex, endVertex, edges, AssignedVeh, AssignedTrip, vehID):
    while AssignedVeh[startVertex][endVertex] < int(round(AssignedTrip[startVertex][endVertex])):
        vehID += 1
        newVehicle = Vehicle(str(vehID))
        newVehicle.route = edges
        vehicles.append(newVehicle)
        
        AssignedVeh[startVertex][endVertex] += 1
    if verbose:
        print 'vehID:', vehID
        print 'AssignedTrip[start][end]', AssignedTrip[startVertex][endVertex]
        print 'AssignedVeh[start][end]', AssignedVeh[startVertex][endVertex]
    
    return vehID