When using NS2 for wireless network simulation, it is possible to generate the CBR data stream to generate the scene file, and when the TCL is imported, the following error may occur:
There are no errors in running 10 nodes above, 5 or 10 are error,
Can ' t read "Node_ (5)": No such element in array while executing "$ns _ Attach-agent $node _ (5) $null _ (1)" (file "Cbr_ N5_M5 "line" invoked from within
After repeated search, found that the CBRGEN.TCL generated CBR data flow when the file is out of the question, we look at the 166th line, this line has a% of the remainder operation, in order to avoid the exception of the author will two number plus 1, so that the node is a little more than a thin.
So we can subtract 1 from the back, and the problem will be solved. Everyone has any ns2 problem, welcome to communicate with each other.
This article belongs to original, reprint please indicate source.
NS2 simulation times Wrong "can ' t read" Node_ (5) ": No such element in array"