I clarified the speed and transmission range of my nodes in TCL code and I need to include their values in my C++ code too. Is there any body who can help with this issue?
One may generate a scenario. Either one can write one's own code to generate a topology of the network. Generate the coordinates of say 100 nodes randomly in a given area of deployment. Construct a graph (adjacency matrix) where any two nodes are neighbors of one another iff the distance between them is less than or equal to their range. Now apply a mobility model to these nodes.
Alternatively, one can use setdest in ns2. I suggest the following reading.
I used setdest in my tcl code, but I need to use the amount of that variable (speed, transmission power, location etc.) in my c++ code. I am trying to implement WCA (Weighted Clustering Algorithm) on WSNs and somewhere inside the c++ code, I need to calculate node's weight amount. In order to do that I need to point to current speed amount of the nodes which is described in the TCL code. I dont know how I can I reach them in c++.
One needs to study the code of setdest in C++, and then one can modify to incorporate one's own parameters.
Another alternative can be to write one's own code independently i.e. one can write one's own simulator or mini-simulator (if one does not need all the libraries provided by ns). It will be in one's own control. One needs to work with random numbers.
Actually, one needs to extend the setdest or other facility to incorporate ones own needs. If one can do that easily, it is fine. If not, one can try other alternative.
In case the corresponding "Agent" in your code is not yours, you have to refer to the documentation to realize what "variable name" is being used for speed or TX-range.
I already used binding for variables, but it doesnt return the transmission range or speed ?! have you ever done it before? I mean getting the amount of speed of nodes in ur c++ ?
Pls follow the steps in slides 13 to 16 (link below), which r very simple to follow. The actual steps are from slides 14 to 16.
In ur case u ll define some variables in TCL domain for holding values of speed and Tx range. The same variables will be called in C++ code using "tcl.eval"....as explained in slides. It worked fine for my application.