Re: [ns] Multiple simulations in NS

2006-05-16 Thread Tuhin Kanti Sharma

hey,
Thanx a lot Filippe. Your help really helped me complete my task. I am
really obliged.

Cheerz
Tuhin
M.Sc. (Computer Science)
Department of Computer Science
University of Delhi
Delhi, India


On 5/16/06, Filippe Jabour [EMAIL PROTECTED] wrote:

 It's more complex then I understood at the first sight. I'm afraid I
 can't help you.
 May be it's possible by using a more complex shell script (that I don't
 know how to create  :(

 begin shell script
ns tcl with initial arguments = generates an output file X
loop
ns tcl with arguments read from file X = generates another X
end loop
 end shell

 Good luck!

 Filippe Jabour
 CES/JF - Engenharia de Telecomunicações
 Coordenador
 32-2102-700432-8817-5645
 http://www.jabour.com.br/
 http://www.gta.ufrj.br/~jabour/
 http://www.cesjf.br



 Tuhin Kanti Sharma wrote:

 thnx a lot for the reply...
 but i need to specify my requirements
 I need to run multiple simulations of a tcl script, based on the results
 wich Im collectin in cc file I need to get the best value for the
 simulation. Now wat I can do is run the simulation get the results and
 update variables in cc and then run the simulation again for the nxt
 value...so I need to control the executions thru tcl or cc.
 What happens is I can only get results after the simulation completes
 so I need to start the simulation again afresh
 can I link two tcl files
 can u suggest nething
 Ill b really greatful for help
 
 Tuhin
 
 
 On 5/15/06, Filippe Jabour [EMAIL PROTECTED] wrote:
 
 
 Ignore the  *
 Consider as spaces.
 
 Filippe Jabour
 http://www.gta.ufrj.br/~jabour/
 
 
 
 
 Filippe Jabour escreveu:
 
 
 Use a shell script.
 
 /#!/bin/csh/
 *set* scriptTcl = dd0601.tcl
 foreach scen *(*1 2 3 4 5 6 7 8 9 10*)*
   *echo* ...
   *echo* Rodada $scen
   *echo* Comando: ns $scriptTcl $scen
   time ns $scriptTcl $scen
   *echo* ...
 end
 
 
 Rodada e Comando are portuguese words. Something like Round and
 Command.
 $scen is an integer argument passed to tcl script to set the file that
 contains the inicial node positions and node movement.
 
 Filippe Jabour
 http://www.gta.ufrj.br/~jabour/
 
 
 
 
 Tuhin Kanti Sharma wrote:
 
 
 
 
 Hi,
 Can we run a tcl simulation multiple times, i.e from start to finish.
 
 
 If yes
 
 
 then how do we do it.
 Help would be appreciated.
 
 Tuhin
 Department of CS
 DU
 
 
 
 
 
 
 



Re: [ns] Multiple simulations in NS

2006-05-16 Thread Tuhin Kanti Sharma

Thnx a lot for ure help and kind suggestions.
Tuhin
Department of CS
DU


On 5/16/06, Zhou Ya Jin [EMAIL PROTECTED] wrote:

 1)First you need to read some books about linux shell program. Then you
 will know  what is the meaning of #!/bin/sh.
 2) That is because your environment variable is not setting properly.
 a) you can change your environment variable
 The .bashrc file is at your home directory

 # .bashrc

 # User specific aliases and functions

 # Source global definitions
 if [ -f /etc/bashrc ]; then
 . /etc/bashrc
 fi

 HOME_NS=/usr/local/ns-allinone-2.29
 NS_DIR=$HOME_NS/bin

 PATH=${PATH}:$NS_DIR:/sbin

 LD_LIBRARY_PATH=$HOME_NS/otcl-1.11:$HOME_NS/lib

 TCL_LIBRARY=$HOME_NS/tcl8.4.11/library

 export HOME_NS NS_DIR LD_LIBRARY_PATH TCL_LIBRARY

 b) if you do not want to change your environment variable ,you can
 use  ./yourns2path/ns  instead of  ns

 - Original Message -
 From: Tuhin Kanti Sharma [EMAIL PROTECTED]
 To: ns-users@ISI.EDU; [EMAIL PROTECTED]
 Sent: Tuesday, May 16, 2006 3:33 AM
 Subject: Re: [ns] Multiple simulations in NS


 
  thnx for ure hlp, smehow my requirement is getting met with wat u hav
 just
  suggested. I need help just in a couple of more points:
  1)/#!/bin/csh/
  what is the significance of this?
 
  2) While running the shell script, it gives :
  ns command not found.
  Can you please tell me why is it so?
 
  I'll be really thankful and greatful for ure help
 
  Tuhin
  Department of CS
  DU
 
 
 
  On 5/16/06, Tuhin Kanti Sharma [EMAIL PROTECTED] wrote:
 
   thnx a lot for the reply...
  but i need to specify my requirements
  I need to run multiple simulations of a tcl script, based on the
 results
  wich Im collectin in cc file I need to get the best value for the
  simulation. Now wat I can do is run the simulation get the results and
  update variables in cc and then run the simulation again for the nxt
  value...so I need to control the executions thru tcl or cc.
  What happens is I can only get results after the simulation completes
  so I need to start the simulation again afresh
  can I link two tcl files
  can u suggest nething
  Ill b really greatful for help
 
  Tuhin
 
 
  On 5/15/06, Filippe Jabour [EMAIL PROTECTED] wrote:
  
  
   Ignore the  *
   Consider as spaces.
  
   Filippe Jabour
   http://www.gta.ufrj.br/~jabour/
  
  
  
  
   Filippe Jabour escreveu:
Use a shell script.
   
/#!/bin/csh/
*set* scriptTcl = dd0601.tcl
foreach scen *(*1 2 3 4 5 6 7 8 9 10*)*
  *echo* ...
  *echo* Rodada $scen
  *echo* Comando: ns $scriptTcl $scen
  time ns $scriptTcl $scen
  *echo* ...
end
   
   
Rodada e Comando are portuguese words. Something like Round and
Command.
$scen is an integer argument passed to tcl script to set the file
 that
contains the inicial node positions and node movement.
   
Filippe Jabour
http://www.gta.ufrj.br/~jabour/
   
   
   
   
Tuhin Kanti Sharma wrote:
   
   
Hi,
Can we run a tcl simulation multiple times, i.e from start to
 finish.
   If yes
then how do we do it.
Help would be appreciated.
   
Tuhin
Department of CS
DU
   
   
   
  
  
 


[ns] Multiple simulations in NS

2006-05-15 Thread Tuhin Kanti Sharma

Hi,
Can we run a tcl simulation multiple times, i.e from start to finish. If yes
then how do we do it.
Help would be appreciated.

Tuhin
Department of CS
DU


Re: [ns] Multiple simulations in NS

2006-05-15 Thread Filippe Jabour

Use a shell script.

/#!/bin/csh/
*set* scriptTcl = dd0601.tcl
foreach scen *(*1 2 3 4 5 6 7 8 9 10*)*
*echo* ...
*echo* Rodada $scen
*echo* Comando: ns $scriptTcl $scen
time ns $scriptTcl $scen
*echo* ...
end


Rodada e Comando are portuguese words. Something like Round and 
Command.
$scen is an integer argument passed to tcl script to set the file that 
contains the inicial node positions and node movement.

Filippe Jabour
http://www.gta.ufrj.br/~jabour/




Tuhin Kanti Sharma wrote:

Hi,
Can we run a tcl simulation multiple times, i.e from start to finish. If yes
then how do we do it.
Help would be appreciated.

Tuhin
Department of CS
DU
  



Re: [ns] Multiple simulations in NS

2006-05-15 Thread Filippe Jabour

Ignore the  *
Consider as spaces.

Filippe Jabour
http://www.gta.ufrj.br/~jabour/




Filippe Jabour escreveu:
 Use a shell script.

 /#!/bin/csh/
 *set* scriptTcl = dd0601.tcl
 foreach scen *(*1 2 3 4 5 6 7 8 9 10*)*
   *echo* ...
   *echo* Rodada $scen
   *echo* Comando: ns $scriptTcl $scen
   time ns $scriptTcl $scen
   *echo* ...
 end


 Rodada e Comando are portuguese words. Something like Round and 
 Command.
 $scen is an integer argument passed to tcl script to set the file that 
 contains the inicial node positions and node movement.

 Filippe Jabour
 http://www.gta.ufrj.br/~jabour/




 Tuhin Kanti Sharma wrote:

   
 Hi,
 Can we run a tcl simulation multiple times, i.e from start to finish. If yes
 then how do we do it.
 Help would be appreciated.

 Tuhin
 Department of CS
 DU
  

 



Re: [ns] Multiple simulations in NS

2006-05-15 Thread Tuhin Kanti Sharma

thnx a lot for the reply...
but i need to specify my requirements
I need to run multiple simulations of a tcl script, based on the results
wich Im collectin in cc file I need to get the best value for the
simulation. Now wat I can do is run the simulation get the results and
update variables in cc and then run the simulation again for the nxt
value...so I need to control the executions thru tcl or cc.
What happens is I can only get results after the simulation completes
so I need to start the simulation again afresh
can I link two tcl files
can u suggest nething
Ill b really greatful for help

Tuhin


On 5/15/06, Filippe Jabour [EMAIL PROTECTED] wrote:


 Ignore the  *
 Consider as spaces.

 Filippe Jabour
 http://www.gta.ufrj.br/~jabour/




 Filippe Jabour escreveu:
  Use a shell script.
 
  /#!/bin/csh/
  *set* scriptTcl = dd0601.tcl
  foreach scen *(*1 2 3 4 5 6 7 8 9 10*)*
*echo* ...
*echo* Rodada $scen
*echo* Comando: ns $scriptTcl $scen
time ns $scriptTcl $scen
*echo* ...
  end
 
 
  Rodada e Comando are portuguese words. Something like Round and
  Command.
  $scen is an integer argument passed to tcl script to set the file that
  contains the inicial node positions and node movement.
 
  Filippe Jabour
  http://www.gta.ufrj.br/~jabour/
 
 
 
 
  Tuhin Kanti Sharma wrote:
 
 
  Hi,
  Can we run a tcl simulation multiple times, i.e from start to finish.
 If yes
  then how do we do it.
  Help would be appreciated.
 
  Tuhin
  Department of CS
  DU
 
 
 




Re: [ns] Multiple simulations in NS

2006-05-15 Thread Tuhin Kanti Sharma

thnx for ure hlp, smehow my requirement is getting met with wat u hav just
suggested. I need help just in a couple of more points:
1)/#!/bin/csh/
what is the significance of this?

2) While running the shell script, it gives :
ns command not found.
Can you please tell me why is it so?

I'll be really thankful and greatful for ure help

Tuhin
Department of CS
DU



On 5/16/06, Tuhin Kanti Sharma [EMAIL PROTECTED] wrote:

  thnx a lot for the reply...
 but i need to specify my requirements
 I need to run multiple simulations of a tcl script, based on the results
 wich Im collectin in cc file I need to get the best value for the
 simulation. Now wat I can do is run the simulation get the results and
 update variables in cc and then run the simulation again for the nxt
 value...so I need to control the executions thru tcl or cc.
 What happens is I can only get results after the simulation completes
 so I need to start the simulation again afresh
 can I link two tcl files
 can u suggest nething
 Ill b really greatful for help

 Tuhin


 On 5/15/06, Filippe Jabour [EMAIL PROTECTED] wrote:
 
 
  Ignore the  *
  Consider as spaces.
 
  Filippe Jabour
  http://www.gta.ufrj.br/~jabour/
 
 
 
 
  Filippe Jabour escreveu:
   Use a shell script.
  
   /#!/bin/csh/
   *set* scriptTcl = dd0601.tcl
   foreach scen *(*1 2 3 4 5 6 7 8 9 10*)*
 *echo* ...
 *echo* Rodada $scen
 *echo* Comando: ns $scriptTcl $scen
 time ns $scriptTcl $scen
 *echo* ...
   end
  
  
   Rodada e Comando are portuguese words. Something like Round and
   Command.
   $scen is an integer argument passed to tcl script to set the file that
   contains the inicial node positions and node movement.
  
   Filippe Jabour
   http://www.gta.ufrj.br/~jabour/
  
  
  
  
   Tuhin Kanti Sharma wrote:
  
  
   Hi,
   Can we run a tcl simulation multiple times, i.e from start to finish.
  If yes
   then how do we do it.
   Help would be appreciated.
  
   Tuhin
   Department of CS
   DU
  
  
  
 
 



Re: [ns] Multiple simulations in NS

2006-05-15 Thread Zhou Ya Jin

1)First you need to read some books about linux shell program. Then you will 
know  what is the meaning of #!/bin/sh. 
2) That is because your environment variable is not setting properly.
a) you can change your environment variable 
The .bashrc file is at your home directory

# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

HOME_NS=/usr/local/ns-allinone-2.29
NS_DIR=$HOME_NS/bin

PATH=${PATH}:$NS_DIR:/sbin

LD_LIBRARY_PATH=$HOME_NS/otcl-1.11:$HOME_NS/lib

TCL_LIBRARY=$HOME_NS/tcl8.4.11/library

export HOME_NS NS_DIR LD_LIBRARY_PATH TCL_LIBRARY

b) if you do not want to change your environment variable ,you can use  
./yourns2path/ns  instead of  ns

- Original Message - 
From: Tuhin Kanti Sharma [EMAIL PROTECTED]
To: ns-users@ISI.EDU; [EMAIL PROTECTED]
Sent: Tuesday, May 16, 2006 3:33 AM
Subject: Re: [ns] Multiple simulations in NS


 
 thnx for ure hlp, smehow my requirement is getting met with wat u hav just
 suggested. I need help just in a couple of more points:
 1)/#!/bin/csh/
 what is the significance of this?
 
 2) While running the shell script, it gives :
 ns command not found.
 Can you please tell me why is it so?
 
 I'll be really thankful and greatful for ure help
 
 Tuhin
 Department of CS
 DU
 
 
 
 On 5/16/06, Tuhin Kanti Sharma [EMAIL PROTECTED] wrote:

  thnx a lot for the reply...
 but i need to specify my requirements
 I need to run multiple simulations of a tcl script, based on the results
 wich Im collectin in cc file I need to get the best value for the
 simulation. Now wat I can do is run the simulation get the results and
 update variables in cc and then run the simulation again for the nxt
 value...so I need to control the executions thru tcl or cc.
 What happens is I can only get results after the simulation completes
 so I need to start the simulation again afresh
 can I link two tcl files
 can u suggest nething
 Ill b really greatful for help

 Tuhin


 On 5/15/06, Filippe Jabour [EMAIL PROTECTED] wrote:
 
 
  Ignore the  *
  Consider as spaces.
 
  Filippe Jabour
  http://www.gta.ufrj.br/~jabour/
 
 
 
 
  Filippe Jabour escreveu:
   Use a shell script.
  
   /#!/bin/csh/
   *set* scriptTcl = dd0601.tcl
   foreach scen *(*1 2 3 4 5 6 7 8 9 10*)*
 *echo* ...
 *echo* Rodada $scen
 *echo* Comando: ns $scriptTcl $scen
 time ns $scriptTcl $scen
 *echo* ...
   end
  
  
   Rodada e Comando are portuguese words. Something like Round and
   Command.
   $scen is an integer argument passed to tcl script to set the file that
   contains the inicial node positions and node movement.
  
   Filippe Jabour
   http://www.gta.ufrj.br/~jabour/
  
  
  
  
   Tuhin Kanti Sharma wrote:
  
  
   Hi,
   Can we run a tcl simulation multiple times, i.e from start to finish.
  If yes
   then how do we do it.
   Help would be appreciated.
  
   Tuhin
   Department of CS
   DU
  
  
  
 
 




Re: [ns] Multiple simulations in NS

2006-05-15 Thread Sameer Qazi

Another way is  through 'for' loop, but make sure you
break up this code (the one to be repeated) as one (or
multiple) subroutines ('procs in tcl') written outside
the 'for' loop.

The code can then be repeatedly called at specific
time intervals using $ns at time subroutine or
proc from a 'for' loop. Time can be incremented
appropriately in each run of for loop.

But you must be careful to set the times (at which the
code is being called as non-overlapping) and the final
'finish' procedure to be called at a time when you
have finished invoking these sub-routines ('procs').

It worked for me, I 'm not sure about your exact
requirements, but you can be able to update the
variables in each run of the 'for' loop as you desire.
BUT be careful while 'for' loops are stable, 'while'
loops take much more effort in coding!   

Cheers. 

--- Tuhin Kanti Sharma [EMAIL PROTECTED] wrote:

 
 thnx for ure hlp, smehow my requirement is getting
 met with wat u hav just
 suggested. I need help just in a couple of more
 points:
 1)/#!/bin/csh/
 what is the significance of this?
 
 2) While running the shell script, it gives :
 ns command not found.
 Can you please tell me why is it so?
 
 I'll be really thankful and greatful for ure help
 
 Tuhin
 Department of CS
 DU
 
 
 
 On 5/16/06, Tuhin Kanti Sharma
 [EMAIL PROTECTED] wrote:
 
   thnx a lot for the reply...
  but i need to specify my requirements
  I need to run multiple simulations of a tcl
 script, based on the results
  wich Im collectin in cc file I need to get the
 best value for the
  simulation. Now wat I can do is run the simulation
 get the results and
  update variables in cc and then run the simulation
 again for the nxt
  value...so I need to control the executions thru
 tcl or cc.
  What happens is I can only get results after the
 simulation completes
  so I need to start the simulation again afresh
  can I link two tcl files
  can u suggest nething
  Ill b really greatful for help
 
  Tuhin
 
 
  On 5/15/06, Filippe Jabour [EMAIL PROTECTED]
 wrote:
  
  
   Ignore the  *
   Consider as spaces.
  
   Filippe Jabour
   http://www.gta.ufrj.br/~jabour/
  
  
  
  
   Filippe Jabour escreveu:
Use a shell script.
   
/#!/bin/csh/
*set* scriptTcl = dd0601.tcl
foreach scen *(*1 2 3 4 5 6 7 8 9 10*)*
  *echo* ...
  *echo* Rodada $scen
  *echo* Comando: ns $scriptTcl $scen
  time ns $scriptTcl $scen
  *echo* ...
end
   
   
Rodada e Comando are portuguese words.
 Something like Round and
Command.
$scen is an integer argument passed to tcl
 script to set the file that
contains the inicial node positions and node
 movement.
   
Filippe Jabour
http://www.gta.ufrj.br/~jabour/
   
   
   
   
Tuhin Kanti Sharma wrote:
   
   
Hi,
Can we run a tcl simulation multiple times,
 i.e from start to finish.
   If yes
then how do we do it.
Help would be appreciated.
   
Tuhin
Department of CS
DU
   
   
   
  
  
 
 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com