Hi all
I am trying to access the value of the initial energy for the energy model
after configuring the nodes. for example after
$ns_ node-config -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 \
-agentTrace OFF \
-routerTrace OFF \
-macTrace ON \
-movementTrace OFF \
-energyModel "EnergyModel" \
-initialEnergy 3 \
-rxPower 0.3 \
-txPower 0.3 \
-IDLE 0.3 \
-channel $chan_1_
#-errProc UniformErr
#-IncomingErrProc UniformErrorProc
#-IncomingErrProc $val(err)
for {set i 2} {$i < $val(nn) } {incr i} {
set node_($i) [$ns_ node]
$node_($i) random-motion 0 ;# disable random motion
}
I want to check the initial energy using an if statement
if {$initialEnergy > 2} { DO WHATEVER}
I will be grateful for your help
Regards
Anas
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.