Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Retrieving vehicle's predecessor

Are you looking for MSVehicle::getLeader()?

Am Mo., 6. Apr. 2020 um 14:56 Uhr schrieb Michael Behrisch <oss@xxxxxxxxxxx>:
Hi Michele,
there is no such function and I don't think there will be one soon. One
workaround could be to retrieve the vehicle ids on the current lane
which are sorted by position, look for your vehicle and take the next
one. This is not documented but unlikely to change. You could do a
double check by asking the resulting vehicle for its leader. But this
will not work across junctions and I am not sure what it returns in the
sublane model.

Best regards,
Michael

Am 06.04.20 um 14:40 schrieb Michele Segata:
> Sorry I made a typo. I meant the successor, not the predecessor of course.
>
> My bad
> Michele
>
> On 06/04/2020 09:59, Michele Segata wrote:
>> Hi all,
>>
>> I was wondering whether there is a convenient way of finding a
>> vehicle's predecessor, something like the getLeader() method of
>> MSLane. I was browsing though the mailing list and I only found this
>> post from 2010 saying it did not exist back then:
>> https://sourceforge.net/p/sumo/mailman/message/26460500/
>>
>> By looking at the code it seems that it doesn't exist yet, but I
>> wanted to be sure before implementing it myself.
>>
>> Thanks
>> Best,
>> Michele
>>
>


_______________________________________________
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