Hi,would anyone tell me the solution to this error:
Skipping duplicate node 0 definition.

The problem may also occurred 
http://mailman.isi.edu/pipermail/ns-users/2006-June/055980.html
but I don't find the answer.

My tcl script:
#############################################################################
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)             8                          ;# 50 common node and 1 sink 
node
set val(rp)             aodv                       ;# routing protocol 
set val(x)              500                        ;# X dimension of the 
topography 
set val(y)              500                        ;# Y dimension of the 
topography 


set ns [new Simulator] 
set tracefd [open simulation_scence_m.tr w] 
$ns trace-all $tracefd 
set namtracefd [open simulation_sence_m.nam w] 
$ns namtrace-all-wireless $namtracefd $val(x) $val(y)
$ns use-newtrace


proc finish {} { 

     global ns tracefd namtracefd 
     $ns flush-trace 
     close $tracefd 
     close $namtracefd 
     exec nam simulation_sence_m.nam & 
     exit 0     
} 

set topo [new Topography] 

$topo load_flatgrid $val(x) $val(y) 
create-god $val(nn) 
set chan_1_ [new $val(chan)] 

#$ns node-config -addressType def\
$ns_ node-config -sensorNode ON \
          -adhocRouting $val(rp) \
          -llType $val(ll)\
          -macType $val(mac)\
          -ifqType $val(ifq)\
          -ifqLen $val(ifqlen)\
          -antType $val(ant)\
          -propType $val(prop)\
          -phyType $val(netif)\
          -topoInstance $topo\
          -energyModel EnergyModel\
          -idlePower 0.0\
          -rxPower 0.25\
          -txPower 0.25\
          -sensePower 0.00000175\
          -initialEnergy 5\
          -agentTrace ON\
          -routerTrace ON\
          -macTrace OFF\
          -movementTrace ON\
          -channel $chan_1_    
             
# define the position of the sink node
set node_(0) [$ns node]
$node_(0) set X_ 500.0    
$node_(0) set Y_ 0.0
$node_(0) set Z_ 0.0
$node_(0) label "sinknode"
$node_(0) shape square
$node_(0) color red 
$ns initial_node_pos $node_(0) 35    ;#add

for {set i 1} {$i < $val(nn) } {incr i} { 
      set node_($i) [$ns node]
     # $node_($i) random-motion 0
     # $ns initial_node_pos $node_($i) 20
}
#$ns initial_node_pos 35    

#difine the position of the common nodes
$node_(1) set X_ 231.47128696156261
$node_(1) set Y_ 411.97707942313377
$node_(1) set Z_ 0.0 
$node_(2) set X_ 250.12041546875631
$node_(2) set Y_ 220.45653137399654
$node_(2) set Z_ 0.0
$node_(3) set X_ 60.80164856314736
$node_(3) set Y_ 497.76306003227972
$node_(3) set Z_ 0.0
$node_(4) set X_ 428.33099161662676
$node_(4) set Y_ 428.64265708655239
$node_(4) set Z_ 0.0
$node_(5) set X_ 201.64284305723518
$node_(5) set Y_ 473.63754360640309
$node_(5) set Z_ 0.0
$node_(6) set X_ 227.25328743795549
$node_(6) set Y_ 251.86512654268424
$node_(6) set Z_ 0.0
$node_(7) set X_ 14.766638872570654
$node_(7) set Y_ 334.004308485428
$node_(7) set Z_ 0.0

$ns at 500.0 "finish" 
$ns run 
#############################################################################   
        
                                
--------------
meshide
2007-01-30

Reply via email to