Professional Documents
Culture Documents
Code ns2
Code ns2
#############################################################################
set opt(row) 3;
set opt(col) 3;
#############################################################################
#############################################################################
#===================================
# ns simulator
#===================================
#===================================
# NAM
#===================================
#===================================
# Trace File
#===================================
#===================================
# Topologie
#===================================
#===================================
# color
#===================================
#===================================
# nodes configuration
#===================================
-llType $opt(ll) \
-macType $opt(mac) \
-ifqType $opt(ifq) \
-ifqLen $opt(ifqlen) \
-antType $opt(ant) \
-propType $opt(prop) \
-phyType $opt(netif) \
-channelType $opt(chan) \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace ON \
-movementTrace ON \
-energyModel $opt(energy) \
-initialEnergy $opt(initialenergy) \
-txPower $opt(txPower) \
-rxPower $opt(rxPower) \
-idlePower $opt(idlePower)
#===================================
#===================================
$node_($nodenum) random-motion 0
#=============================================
# Nodes Color
#=============================================
#=============================================
# Communication Set up
#=============================================
#===================================
# Termination
#===================================
proc finish {} {
$ns_ flush-trace
close $tracefile
$ns_ run