Hello all,
I am running the following script in fedora 9, ns-2.34 at HP DV6700 laptop that 
is dual core (1.86 processor each) with 1 Gb RAM. The simulation time in this 
script is 900 simulated seconds ( val(stop) = 900 ). The script take a lot time 
to run perhaps 1 or 1 and half hour. Is it normal or there is something wrong 
in this script?
 
# Define options 
set val(chan)           Channel/WirelessChannel    ;# channel type 
set val(prop)           Propagation/TwoRayGround   ;# radio-propagation model 
set val(netif)          Phy/WirelessPhy            ;# network interface type 
set val(mac)            Mac/802_11                 ;# MAC type 
set val(ifq)            Queue/DropTail/PriQueue    ;# interface queue type 
set val(ll)             LL                         ;# link layer type 
set val(ant)            Antenna/OmniAntenna        ;# antenna model 
set val(ifqlen)         50                         ;# max packet in ifq 
set val(nn)             50                         ;# number of mobilenodes 
set val(rp)             DSDV                       ;# routing protocol 
set val(x)              1000                  ;# X dimension of topography 
set val(y)              1000                  ;# Y dimension of topography  
set val(sc)             "pause-0"
set val(cp)             "seed-1-test"
set val(stop)        900               ;# time of simulation end 

# Simualtor instance 
set ns_          [new Simulator]

# opening files for traces
set tracefd       [open tr-dsdv0.tr w] 
 
$ns_ use-newtrace
$ns_ trace-all $tracefd 
 
 
# set up topography object 
set topo       [new Topography] 
$topo load_flatgrid $val(x) $val(y) 
 
set god_ [create-god $val(nn)]
 
# 
#  Create nn mobilenodes [$val(nn)] and attach them to the channel.  
# 

set chan_1_ [new $val(chan)]
 
# configure the nodes 
        $ns_ node-config -adhocRouting $val(rp) \ 
             -llType $val(ll) \ 
             -macType $val(mac) \
             -channel $chan_1_ \ 
             -ifqType $val(ifq) \ 
             -ifqLen $val(ifqlen) \ 
             -antType $val(ant) \ 
             -propType $val(prop) \ 
             -phyType $val(netif) \ 
             -topoInstance $topo \ 
             -agentTrace ON \ 
             -routerTrace ON \ 
             -macTrace OFF \ 
             -movementTrace ON \    
              
    for {set i 0} {$i < $val(nn) } { incr i } {
        set node_($i) [$ns_ node]
    }

#
# preparing for dynamic initial position of mobilenodes
#
# Define traffic model
#
puts "Loading scenario file..."
source $val(sc)

puts "Loading connection pattern file..."
source $val(cp)

# Telling nodes when the simulation ends 
for {set i 0} {$i < $val(nn) } { incr i } { 
    $ns_ at $val(stop) "$node_($i) reset"; 
} 
 
# ending nam and the simulation  
$ns_ at $val(stop) "stop" 
$ns_ at $val(stop) "puts \"Simulation ends successfully !!\"; $ns_ halt"


#
# procedure to define action to be taken when simualtion ends
#

proc stop {} { 
    global ns_ tracefd namtrace 
    $ns_ flush-trace 
    close $tracefd 
    exit 0 
}


# starting the simulation
$ns_ run


      

Reply via email to