Result File Names

106 views
Skip to first unread message

Brett O'Connor

unread,
Aug 21, 2012, 9:22:24 PM8/21/12
to omn...@googlegroups.com
I would like to name my result files according to the number of nodes in my simulation. In the omnetpp.ini I have **.numNodes = ${2..200 step 2} . I looked in the Omnet++ manual and all that was said about result file names was:

Simulation results are recorded into output scalar files that actually hold statistics results as well, and output vector files. The usual file extension for scalar files is .sca, and for vector files .vec.

Every simulation run generates a single scalar file and a vector file. The file names can be controlled with the output-vector-file and output-scalar-file options. These options rarely need to be used, because the default values are usually fine. The defaults are:

output-vector-file = "${resultdir}/${configname}-${runnumber}.vec"
output-scalar-file = "${resultdir}/${configname}-${runnumber}.sca"
Here, ${resultdir} is the value of the result-dir configuration option which defaults to results/, and ${configname} and ${runnumber} are the name of the configuration name in the ini file (e.g. [Config PureAloha]), and the run number. Thus, the above defaults generate file names like results/PureAloha-0.vec, results/PureAloha-1.vec, and so on.

NOTE
In OMNeT++ 3.x, the default result file names were omnetpp.vec and omnetpp.sca, and scalar files were always appended to, rather than being overwritten as in the 4.x version. When needed, the old behavior for scalar files can be turned back on by setting output-scalar-file-append=true in the configuration.

I tried adding ${numNodes} and even ${0}, but it didn't work. Any help would be great.

tomi

unread,
Aug 22, 2012, 5:19:26 AM8/22/12
to omn...@googlegroups.com
Define a named iteration variable in the ini file as:

**.numNodes = ${n=2..200 step 2}

and use ${n} to refer it.

See also section 9.4.2 of the manual.

Brett O'Connor

unread,
Aug 26, 2012, 9:57:40 AM8/26/12
to omn...@googlegroups.com
Thank you, that works perfectly. I was too busy searching for " output-vector-file"!
Reply all
Reply to author
Forward
0 new messages