The second version (departLane='1') is correct use of the API. However, in SUMO lane indices start counting at 0 so if you insert the vehicle on a 1-lane road, the error ' Invalid departlane definition...' will occur.
regards, Jakob Am Mi., 5. Juni 2019 um 07:15 Uhr schrieb Pratik Dutta <[email protected] >: > Pardon, version is 1.1.0 > > > > *Regards,* > Pratik Dutta > Mob: 8017342498 > > > On Wed, Jun 5, 2019 at 10:43 AM Pratik Dutta <[email protected]> wrote: > >> sumo 1.2.0 >> SOrry for the double post, actually the post was not showing in the list >> >> >> >> *Regards,* >> Pratik Dutta >> Mob: 8017342498 >> >> >> On Wed, Jun 5, 2019 at 2:45 AM Jakob Erdmann <[email protected]> >> wrote: >> >>> what version of sumo are you using? >>> Also, please don't double-post your questions. There are already enough >>> mails on this list. >>> >>> Am Di., 4. Juni 2019 um 16:35 Uhr schrieb Pratik Dutta < >>> [email protected]>: >>> >>>> Hello everyone, >>>> I want to insert an vehicle to the network using the code >>>> >>>> traci.vehicle.add('X', rID, typeID='DEFAULT_VEHTYPE', depart='72', >>>> *departLane=int(1)*, departPos=str(tempPostion), departSpeed='0', >>>> arrivalLane="1", arrivalPos='max', arrivalSpeed='current', fromTaz='', >>>> toTaz='', line='', personCapacity=0, personNumber=0) >>>> >>>> but the error occured like this >>>> tc.TYPE_STRING, len(val)) + str(val).encode("latin1") >>>> TypeError: object of type 'int' has no len() >>>> >>>> then, i started debug, and found the code of >>>> traci._vehicle.add(.........) >>>> where there is a loop with variable name val, and that val content >>>> should be sring, hence the above error triggered. >>>> >>>> ------------------------------------------------------------------------------------------------ >>>> So I decided to change the departLane to string, so the code would be >>>> like >>>> >>>> traci.vehicle.add('X', rID, typeID='DEFAULT_VEHTYPE', depart='72', >>>> *departLane='1'*, departPos=str(tempPostion), departSpeed='0', >>>> arrivalLane="1", arrivalPos='max', arrivalSpeed='current', fromTaz='', >>>> toTaz='', line='', personCapacity=0, personNumber=0) >>>> >>>> and the following error occurs, >>>> traci.exceptions.TraCIException: Invalid departlane definition for >>>> vehicle 'X'. >>>> >>>> --------------------------------------------------------------------------------------------------- >>>> the departLane should be within ("random", "free", "allowed", "best", >>>> "first", or an int>=0) >>>> >>>> so, what should be the exact code to insert a new vehicle to the >>>> network? >>>> >>>> >>>> >>>> *Regards,* >>>> Pratik Dutta >>>> >>>> _______________________________________________ >>>> sumo-user mailing list >>>> [email protected] >>>> To change your delivery options, retrieve your password, or unsubscribe >>>> from this list, visit >>>> https://www.eclipse.org/mailman/listinfo/sumo-user >>>> >>> _______________________________________________ >>> sumo-user mailing list >>> [email protected] >>> To change your delivery options, retrieve your password, or unsubscribe >>> from this list, visit >>> https://www.eclipse.org/mailman/listinfo/sumo-user >>> >> _______________________________________________ > sumo-user mailing list > [email protected] > To change your delivery options, retrieve your password, or unsubscribe > from this list, visit > https://www.eclipse.org/mailman/listinfo/sumo-user >
_______________________________________________ sumo-user mailing list [email protected] To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
