[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] Accessing energy state in a routing agent
hi,
I am trying to simulate routing of packets based on the energy level of nodes
. I need to know how can one send the current energy level of the node to the
routing agent attached to that node .
As an example when we do :
"node-config -adhocrouting DSDV "
We make a new Agent/DSDV and send node id as a parameter , now this id (
address) remains constant throughout the simulation ( I am assuming this!)
whereas the energy level of the node changes all the time and my routing agent
needs to know this energy level to construct packets .
I want to know if i pass the node itself as a parameter during the creation to
DSDV constructor then will i be able to access
node->energymodel()->energy_
and get the energy value correctly ?
I think it boils down to if the parameter passing is by reference or by value
between and OTcl and C++ . Is there any other way u might suggest to get to
know the energy level of the node to which my routing agent is attached?
thanks ,
nitin