LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   giving scenario file at terminal in ns2.35 (https://www.linuxquestions.org/questions/linux-newbie-8/giving-scenario-file-at-terminal-in-ns2-35-a-4175555759/)

rc49 10-10-2015 02:41 AM

giving scenario file at terminal in ns2.35
 
system specifications
ubuntu 12.04 32 bit
network simulator 2.35

i want to give topology file at run time in ns2.35
working on random scenarios,, so have to run numerous simulations for statistics but every time running topology ,,i have to rewrite topology file name in TCL script which is very time consuming
this is what i was doing before

in myscript.tcl i write following lines
Code:

# myscript.tcl
set val(sc) "./t1"            ;# t1 is nodes topology/scenario file
source $val(sc)


it is running successfully ,,, but so as to run numerous various topologies i have to rewrite file name i.e t1..assuming rest of the parameters are same..
i want to give topology file at terminal such as
Code:

ns myscript.tcl < t1
for this i add some lines in my tcl script
Code:

set vals [read stdin]
puts "I am valued as "

but it is only reading the file,,,topology is not actually executed by simulator.. nodes are not placed at the positions as mentioned in scenario file

i tried one thing more so as to source the instance of variable
Code:

set v "[ read stdin]"
source $v

it is running without any error but toplogy still not executed...nodes are not positioned at the XY positions mentioned in scenario file
dont know ..which step i missed....


All times are GMT -5. The time now is 07:42 AM.