LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-30-2015, 04:34 AM   #1
Zahraa Ayad
LQ Newbie
 
Registered: Dec 2014
Posts: 19

Rep: Reputation: Disabled
Lightbulb Getting the remaining energy of nodes in NS-2


Hi ...
I am using NS-2.35 and I want to check the remaining energy of nodes during the simulation in my TCL code ... I am using the "energy" variable that represents the energy level of nodes. I am trying to use it like this :

Code:
 puts [node_(2) energy]
but it gave me the value of the initial energy of the node.
I want to get the energy level at specific time. How to do this?
Can you please help me?
 
Old 07-01-2015, 01:09 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,661

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by Zahraa Ayad View Post
Hi ...
I am using NS-2.35 and I want to check the remaining energy of nodes during the simulation in my TCL code ... I am using the "energy" variable that represents the energy level of nodes. I am trying to use it like this :
Code:
 puts [node_(2) energy]
but it gave me the value of the initial energy of the node. I want to get the energy level at specific time. How to do this? Can you please help me?
Haven't we been here before?
http://www.linuxquestions.org/questi...s2-4175531437/

Again, we will be happy to help you, so post what YOU have written/tried and tell us where you're stuck.
 
Old 07-01-2015, 02:40 PM   #3
Zahraa Ayad
LQ Newbie
 
Registered: Dec 2014
Posts: 19

Original Poster
Rep: Reputation: Disabled
I know , but this time I specify what I am doing and where I am stuck. So I hope you can help me.
 
Old 07-01-2015, 05:05 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,661

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by Zahraa Ayad View Post
I know , but this time I specify what I am doing and where I am stuck. So I hope you can help me.
...and you STILL have not posted the code that YOU WROTE. Again, we will be happy to help you, but we WILL NOT write your code for you. Post what you have written/tried, and tell us where you're stuck.

All you've done here is restate your original question.
 
Old 07-04-2015, 03:52 AM   #5
Zahraa Ayad
LQ Newbie
 
Registered: Dec 2014
Posts: 19

Original Poster
Rep: Reputation: Disabled
This is my code ... the problem is when I print the energy level it gave me the initial energy value and I want to get the remaining energy of nodes.
Attached Files
File Type: txt energy.tcl.txt (3.6 KB, 58 views)
 
  


Reply

Tags
energy, ns2, tcl



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting the remaining energy in nodes in ns2 Zahraa Ayad Linux - Networking 1 01-19-2015 09:44 AM
how to set different energy level to different nodes in ns2 Aska123 Linux - Software 0 02-17-2014 02:44 PM
Energy.awk required to compute remaing energy of nodes. Aska123 Linux - Wireless Networking 2 02-02-2014 02:31 AM
Remaining Battery Energy/Lifetime Detection Siva4Linux Linux - Laptop and Netbook 4 12-19-2006 04:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration