On Veins, how to get some values from ini file?

百般思念 提交于 2019-12-11 10:13:28

问题


On Veins applications (veins/src/modules/application/app_name.(cc, h), how to get values like *.car[*].appl.numVehicles from theini file?

I can get values like sim-time-limit (see below) and anothers createad by me one, by I can't acess values on *.car[*].* or *.rsu[*].* from ini file.

stringTmp = ev.getConfig()->getConfigValue("sim-time-limit");

I'd appreciate any help


回答1:


I got the "numVehicles" parameter from the .ini file using the following codification:

long numV = Veins::TraCIScenarioManagerLaunchdAccess().get()->par("numVehicles").longValue();

I hope this can help you.

Douglas




回答2:


Reading parameter values of a module can be done via a call to this module's par(...) method.

I would highly recommend doing the TicToc tutorial, where this is demonstrated succinctly



来源:https://stackoverflow.com/questions/35075324/on-veins-how-to-get-some-values-from-ini-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!