next up previous contents index
Next: 19.1 The C++ EnergyModel Up: 2. Simulator Basics Previous: 18.5.2 C/C++

19. Energy Model in ns

Energy Model, as implemented in , is a node attribute. The energy model represents level of energy in a mobile host. The energy model in a node has a initial value which is the level of energy the node has at the beginning of the simulation. This is known as initialEnergy_. It also has a given energy usage for every packet it transmits and receives. These are called txPower_ and rxPower_. The files where the energy model is defined are  ns/energymodel[.cc and.h]. Other functions/methods described in this chapter may be found in  ns/,  ns/,  ns/tcl/lib[ns-lib.tcl, ns-node.tcl, ns-mobilenode.tcl].