- Home Page of ProjectGuideline.com ›
- Forums ›
- Linux Users ›
- NS2 PROBLEM: Where to type codes?
Hello everyone,
I am new to linux. I’m using Ubuntu.
I have installed NS2. It is working fine (I have tested examples through ‘terminal’ by copy pasting the example after typing ‘ns’. it opened NAM and showed me the simulation).
My problem is, how do i save my tcl script from the terminal? is there a way to first type them out and then run them? (like how we compile c codes?)
Secondly, where to type the C++ codes? How to link TCL and C++ codes?
I need a step by step guide on this. If possible please type out the steps with a simple example.[/b]
Open any text editor and key-in your ns2/tcl simulation script and save it with extention “tcl” like experiment1.tcl.
After that, you can run it from the terminal window ( here we assumed that ns2 is already installed in that machine)
# ns experiment1.tcl
Writing C++ level agent or modifying an existing agent/protocol and compiling ns2 is little bit difficult than that of writing and running a tcl level simulation script . So, you can not get any simple “step by step” answer for your second question. Learn it from appropriate tutorials.
You may start learning it from the following link
http://www.projectguideline.com/modules.php?name=Forums&file=viewtopic&t=13