What you can do is go to TraCIScenarioManager.h and
paste: std::list<std::string> commandGetRouteIdList();
Then in TraCIScenarioManager.cc paste:
std::list<std::string> TraCIScenarioManager::commandGetRouteIdList(){
return genericGetStringList(CMD_GET_ROUTE_VARIABLE, "", ID_LIST,
RESPONSE_GET_ROUTE_VARIABLE);
}
This will give at any time the list of route id's, e.g. route0, route1,
etc.. I just made it, works fine for me.
If you want to know this information at the start of the simulation you can
go in TraCIDemo11p.cc file in the first function : void
TraCIDemo11p::initialize(int stage). The if statment (if stage ==0) is
executed only one time when a vehicle enteres the simulation, maybe you can
do what you want there for example when the fist vehicle enters the
simulation.
Best,
Pavlos
2014-02-20 20:32 GMT+02:00 Deepak Ananth Rama <[email protected]>:
>
> Thanks Pavlos.
>
> Yes, I am using Veins, with Sumo 0.19.0
>
> I am aware of the function (traci->getManager()->commandGetRouteId(
> traci->getExternalId()). But this works for a particular nodeId
>
> What I need is a list of all routes that were loaded onto the simulation.
> Similar to "commandGetLaneIds()" which returns a list of all lane Ids. I
> need to make a listing of all routes before the nodes are added to the
> simulation.
>
> I was looking at this -
> VariableValueTypeDescriptionid list (0x00)stringListReturns a list of ids
> of all currently loaded routes (the given route ID is ignored)
>
> --------------------------
> Thanks,
> Deepak
> ------------------------------
> *From: *"Pavlos Basaras" <[email protected]>
> *To: *"Deepak Ananth Rama" <[email protected]>
> *Cc: *"sumo-user" <[email protected]>
> *Sent: *Thursday, February 20, 2014 12:31:50 AM
> *Subject: *Re: [sumo-user] TraCIScenarioManager function to obtain list
> of all route Ids
>
>
> Hello,
>
> if you are using VEINS, the command:
> traci->getManager()->commandGetRouteId( traci->getExternalId() ) should
> give you the route id of each vehicle. If your version of VEINS does have
> this function try from GitHub: https://github.com/sommer/veins .
>
> Best,
> Pavlos
>
>
> 2014-02-20 4:18 GMT+02:00 Deepak Ananth Rama <[email protected]>:
>
>> Hi.
>>
>>
>> I had a couple of questions on retrieving route ids in the simulation -
>>
>>
>> TraCIScenarioManager has couple of functions to access vehicle / lane /
>> edge information etc. during runtime.
>>
>>
>>
>>
>> * Is there a function to access the list of all route IDs in the
>> simulation? Couldn't find that in TraCIScenarioManager, but a reference to
>> that exists on the SUMO wiki (
>> http://sourceforge.net/apps/mediawiki/sumo/index.php?title=TraCI/Route_Value_Retrieval)
>> * Routes without IDs (such as those generated via duarouter have a
>> route defined internal to each car) - how are these handled by a function,
>> if any from the above?
>>
>>
>>
>>
>>
>>
>> -------------------------------------------------------------------------------------------------------------------------------------------------
>> Thanks,
>> Deepak Ananth Rama
>> Graduate Student, Computer Science Department
>> Email: [email protected]
>>
>> Phone: +1 (925) 918-5035
>>
>> ------------------------------------------------------------------------------
>> Managing the Performance of Cloud-Based Applications
>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
>> Read the Whitepaper.
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
>> _______________________________________________
>> sumo-user mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/sumo-user
>>
>
>
>
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
sumo-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sumo-user