LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 01-28-2016, 12:11 AM   #1
Rita Ahmad
LQ Newbie
 
Registered: Mar 2015
Posts: 28
Blog Entries: 3

Rep: Reputation: Disabled
Running a simulation for multiple times in ns2.35


In ns2.35, I need to run my tcl file several times and then find the average of all outputs. I tried to add some statements (for loops) in the tcl file but none of them is working. Regarding finding the average I know what to do so, but my problem is in running it for multiple times.

Any suggestions?

Last edited by Rita Ahmad; 01-28-2016 at 02:22 AM.
 
Old 01-29-2016, 10:07 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Rita Ahmad View Post
In ns2.35, I need to run my tcl file several times and then find the average of all outputs. I tried to add some statements (for loops) in the tcl file but none of them is working. Regarding finding the average I know what to do so, but my problem is in running it for multiple times.

Any suggestions?
Not without seeing your code...since you've been posting about NS2 for about a year now, you must have SOME thoughts...
 
Old 02-02-2016, 08:44 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
@Rita Ahmad :

AFAIK, there is no automatic solution which is smarter than simply doing the simulation command manually, multiple times.

Getting the terminal output as a file : $ ns file.tcl 2>&1 | tee text1.txt


If the trace files etc. have different results from every simulation :
Simply setup multiple folders with the simulation file, and run $ ns file.tcl in each folder/.


-
 
Old 02-06-2016, 12:15 PM   #4
Rita Ahmad
LQ Newbie
 
Registered: Mar 2015
Posts: 28

Original Poster
Blog Entries: 3

Rep: Reputation: Disabled
Running a simulation for multiple times in ns2.35

I thought it can be done using a loop or something similar. Thanks a lot for your reply.


Quote:
Originally Posted by knudfl View Post
@Rita Ahmad :

AFAIK, there is no automatic solution which is smarter than simply doing the simulation command manually, multiple times.

Getting the terminal output as a file : $ ns file.tcl 2>&1 | tee text1.txt


If the trace files etc. have different results from every simulation :
Simply setup multiple folders with the simulation file, and run $ ns file.tcl in each folder/.


-
 
  


Reply

Tags
ns2



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
NS2: Require eap-sim authentication code for simulation in ns2.24 noamankhatib Linux - Software 0 04-29-2013 12:03 PM
How many times should I run the simulation in ns2? askerwhat Linux - Software 0 11-01-2012 05:51 PM
NS2 network simulation problem:Change queue parameters dynamically during simulation raeisy Linux - Networking 1 11-21-2010 11:30 AM
Avoid script running multiple times by file lock edenCC Linux - Newbie 6 10-23-2009 06:21 AM
running wget multiple times quickk Linux - Newbie 1 09-16-2004 06:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 04:49 AM.

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