for {set i 0} {$i < 5 } {incr i } {set E($i) [expr rand()*1000];#Energy is applied within 1000 Jules$ns node-config \-initialEnergy $E($i)set node_($i) [$ns node] ;#node creation}