在静脉上,如何从ini文件中获取一些值? [英] On Veins, how to get some values from ini file?

查看:98
本文介绍了在静脉上,如何从ini文件中获取一些值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

静脉 应用程序(veins/src/modules/application/app_name.(cc, h)上,如何获取类似 ini文件中的*.car[*].appl.numVehicles?

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

我不能从ini文件中获取*.car[*].**.rsu[*].*上的值,所以我可以得到类似sim-time-limit的值(请参见下文)和其他值.

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");

我将不胜感激

推荐答案

我使用以下编码从.ini文件中获取了"numVehicles"参数:

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.

道格拉斯

这篇关于在静脉上,如何从ini文件中获取一些值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆