Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Setting a stop duration with traci.vehicle.setBusStop does not work

Hello Harald,
according to my tests, the new duration is set correctly, It's only that traci still reports the value that was originally set. This is now fixed.

regards,
Jakob

Am Do., 11. Nov. 2021 um 09:42 Uhr schrieb Harald Schaefer <fechsaer@xxxxxxxxx>:

Dear all, hi Jakob,

currently I want to use  traci.vehicle.setBusStop to set a new duration for a bus stop.

This is my function

def extendCurrentStop(vehID, newDuration, stopData = None):
    try:
        if stopData == None:
            stopData = traci.vehicle.getStops(vehID, 1)
        traci.vehicle.setBusStop(vehID, stopData[0].stoppingPlaceID,
                                 duration=newDuration)
        newStopData = traci.vehicle.getStops(vehID, 1)
        printVehicleMessage(vehID, 'new %s' % newStopData)
        if newStopData[0].duration != newDuration:
          printVehicleMessage(vehID, 'setting of duration does not work')
        else:
          printVehicleMessage(vehID, 'setting of duration does work')
    except Exception as ex:
        printVehicleMessage(vehID, 'error %s' % (str(ex)))
        printVehicleMessage(vehID, 'stopData old %s' % (stopData[0]))

and this are the print outs

time  4993s vehicle 6 new StopData(lane=DeltaLoop26_1, startPos=2.41, endPos=12.31, stoppingPlaceID=busStop_DeltaLoop26_1_5, stopFlags=8)
time  4993s vehicle 6 setting of duration does not work
time  4993s vehicle 6 new duration -1073741824

It seems, that this is working if duration was previously set, but not if duration was never set.

I used setStop in the past, but the conversion from lane to edgesand the adding of the position is extra code, which I want to avoid.

Regards, Harald

_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top