Errors while variable arithmetic in configuration

2019-08-29 12:46发布

I want to calculate an ini variable depending on a different variable and a number, but I can't get it to work. I tried different versions of the following code - with and without brackets around the term:

warmup-period = ${warmup = 0}s
sim-time-limit = ${stime = ${warmup} + 2400}s

OMNeT++ always gives me this error:

Error: Could not read option sim-time-limit= from the configuration: Syntax error parsing quantity '0 + 2400s': Garbage after first number

I also tried using ($warmup) instead of ${warump} as suggested by the manual, but this gives me the following error:

Error: Could not read option sim-time-limit= from the configuration: Syntax error parsing quantity '(0) + 2400s': Must begin with a number

I am using OMNeT++ version 5.1.

标签: omnet++
1条回答
姐就是有狂的资本
2楼-- · 2019-08-29 13:06

It is impossible to use an INI variable for sim-time-limit, because the simulation environment expects only a number (with unit). Here is the line from src\envir\envirbase.cc which reads the value of sim-time-limit:

opt->simtimeLimit = cfg->getAsDouble(CFGID_SIM_TIME_LIMIT, -1);
查看更多
登录 后发表回答