0

In .ini file of OMNET++, I want to generate user locations such that inter-location distance is exponentially distributed. I tried using the following code:

*.user[0].mobility.initialX = ${X0 = 100m}
*.user[1].mobility.initialX = ${X1 = ${X0} + exponential(100)*1m}
*.user[2].mobility.initialX = ${X2 = ${X1} + exponential(100)*1m}
*.user[3].mobility.initialX = ${X3 = ${X2} + exponential(100)*1m}
*.user[4].mobility.initialX = ${X3} + exponential(100)*1m

But it seems that due to textual substitution, the expressions are not evaluated the way I want.

I expected that the order of user locations would be user[0] --> user[1] --> user[2] --> user[3] --> user[4]. However, it appears that, for example, when X1 is used for defining X2, the old value of X1 (in the previous line) is not used but rather, a new value is generated (i.e., a new number is drawn from the exponential distribution). So, the final user locations are not in the order I want.

Is this behavior due to textual substitution or any other reason? If its due to textual substitution, is there any way to over-ride it?

Thank you.

0 Answers0