Hi, The following statement gives you the energy in 'er' for the node 'id' set er [$node_($id) getER]
Use this anywhere you want. Make a loop for the cluster you are concerned about to find the total energy of the nodes in that respective cluster. I dont know much about the decideclusterhead proc and that which variable holds the list of the cluster nodes. Where it creates the TDMAschedule, look at there. TDMAschedule also keeps the list of cluster nodes. I hope it may work, if I really understand your problem. Good luck Shafiq ----- Original Message ----- From: Qiguang Huang To: [EMAIL PROTECTED] Sent: Sunday, July 16, 2006 3:54 AM Subject: ask you a question i want to elect cluster heads with the residual energy of the nodes within clusters. so i want to get the residual energy of the nodes within clusters in decideclusterhead procedure. i know in leach we can use the list clusterNodes_ to calculate energy of the nodes within clusters. But i dont know why it is error when i try to use it in the decideclusterhead procedure. please give me some advice. how should i do if i want to get the result above mention. looking for your reply soon. ------------------------------------------------------------------------------ 雅虎免费邮箱-3.5G容量,20M附件