I am writing code for a simple simulation. We have 10 nodes and one sink node.
I want to run the simulation for 5 times.
The only thing I know so far is that I need to write set val(repeatTimes) 5
, but I don't know how to use it in the simulation. Also, I add two lines of code as follow in the corresponding mac-simple.cc file in order to receive the repeat time from ns2. Then I compile the .cc file and run the simulation. However, when I run the .tcl file it shows me an error that it cannot find the repeatTimes variable.
Here are the two lines of code that I add under the function Mac():
tcl.evalf("Mac/Simple set repeatTimes");
bind("repeatTimes", &repeatTimes);
Do you the solution to this problem? If you don't know the solution, can you please guide me towards a forum/website where I can look for the solution?
Thanks in advance