File: topo-gen-script.tcl

package info (click to toggle)
ns2 2.35%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 78,796 kB
  • sloc: cpp: 172,923; tcl: 107,130; perl: 6,391; sh: 6,143; ansic: 5,846; makefile: 816; awk: 525; csh: 355
file content (40 lines) | stat: -rw-r--r-- 1,273 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# make sure that gt-itm and ns conversion prog are in the path !!!XXX

# until the these two files become part of the release, we
# need to source them
source topo-gen.tcl 
source topo-view.tcl 

# the files that will contain the topology scripts and nam dump files
set topofile mytopo
set topoext tcl
set outfile nam-view-test
set outext nam

set topology_number 1
set hier_flag 0

# create 3 flat random topologies of 12 nodes, with connection 
# probability of 0.25
# for more help on the topology command type "topology -h"
for { set i 0 } { $i < $topology_number } { incr i } {
	topology -outfile $topofile-$i.$topoext -nodes 12 -connection_prob 0.25
#	topology -outfile $topofile-$i.$topoext -type transit_stub -nodes 100 \
 	    -connection_prob 0.1	
}

# after creation, view the topology, the first layout in nam is going
# to be a mess, hit re-layout to get a reasonable layout.
# for now, sgb2ns and sgb2hierns are not combined ; hence pass a flag to view-topology
# 
for { set i 0 } { $i < $topology_number } { incr i } {
	view-topology $topofile-$i.$topoext $outfile-$i.$outext $hier_flag

        puts "Do you want to view another toplogy (Y/N) ?! \[N\]"
        gets stdin x
        if ![regexp {^(y|Y|yes|Yes|YES)} $x] {
                break
        }
}