[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] Energy Model and god.cc



Hi All,

The only places in god.cc where I can find any
references to the energy model are:

bool God::IsNeighbor(int i, int j)
{
  assert(i<num_nodes && j<num_nodes);

  //printf("i=%d, j=%d\n", i,j);
  if (mb_node[i]->energy_model()->node_on() == false
||
      mb_node[j]->energy_model()->node_on() == false
||
      mb_node[i]->energy_model()->energy() <= 0.0 ||
      mb_node[j]->energy_model()->energy() <= 0.0 ) {
    return false;
  }

  vector a(mb_node[i]->X(), mb_node[i]->Y(),
mb_node[i]->Z());
  vector b(mb_node[j]->X(), mb_node[j]->Y(),
mb_node[j]->Z());
  vector d = a - b;

  if (d.length() < RANGE)
    return true;
  else
    return false;  
}

void God::CountAliveNode()
{
  int i;

  num_alive_node = 0;

  for (i=0; i<num_nodes; i++) {
    if (mb_node[i]->energy_model()->energy() > 0.0) {
      num_alive_node++;
    }
  }

}

Now I don't see any reference to the energy model at
places where it computes the route though according to
the writers of the paper:

Power-Aware Routing in Wireless Packet Networks

a protocol is/is being implemented in NS2 that
computes routs based on the energy level of the nodes.
That power-aware algorithm has been implemented in
god.cc or somewhere else?

Thanks in advance,

Ahmad

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com