The following steps show the way of generating mobility pattern files (also known as scenario files) using the setdest command which is available under ns2 installation :
(Do not make any typo errors)
1. Run a Linux/Cygwin terminal window.
2. Type pwd to know where you are. (if you want to know)
3. Type cd /ns-allinone-2.29/ns-2.29/indep-utils/cmu-scen-gen/setdest to change to the directory
4. Again type pwd to know where you are. (if you want to know)
5. If you type setdest wiout ./ you will see an error
6. So type ./setdest you will see some help message about the syntax of using the command.
If you want to generate nodes 20, pause time 20, Max Speed 20, Simulation time 20, X topo area 500, Y topo area 500, then you have to issue the following command
#./setdest -v 1 -n 20 -p 20 -M 20 -t 20 -x 500 -y500 You will see the following.
If you want to redirect the output to a scenario file name test.sce then you have to issue the command as follows :
#./setdest -v 1 -n 20 -p 20 -M 20 -t 20 -x 500 -y500 > test.sce
The output will be saved in test.sce.
Then we can use the test.sce from any Tcl script using “source” command
Nothing will be displayed on the screen.
All will be inside test.sce.
You can open it using any editor in windows and see all the entries.