LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   graph ns2 (https://www.linuxquestions.org/questions/linux-software-2/graph-ns2-791067/)

wa1961 02-23-2010 02:11 PM

graph ns2
 
Hi all.
I'm just installed ns 2.31 in my cumputer:fedora 12 (this is the first time working with ns2 and fedora) but I don't know commands to run an example of tcl script and show the graph in my screen. plz help me.

knudfl 02-23-2010 03:39 PM

Welcome LQ.

I assume that you have run ./validate with few or no errors.
And you can check nam : 1) cd nam-<version>/ , 2) ./nam
.. to see the nam GUI open.
http://www.linuxquestions.org/questi...lem-726993/#12

The command to run an example : ns2 example-Xx.tcl
Some example files will open nam at once and show the simulation.
Other examples will create a file : nam.out , which can be run
with : nam nam.out

ns 2 info : LQ Search → TagName = ns2
http://www.linuxquestions.org/questions/search.php
http://www.linuxquestions.org/questi...2&pp=50&page=2

Examples and tutorial ..
http://www.linuxquestions.org/questi.../ns2-781274/#2
.....
P.S. : ns-2.34 is the latest version.
.....

wa1961 02-23-2010 05:04 PM

Thanks very much for ur help,
But while I run ./nam it doesn't show the GUI:

nam:
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D)}] units
}
bind Li..."

what is this error?

raju.mopidevi 02-23-2010 05:20 PM

Quote:

Originally Posted by wa1961 (Post 3874320)
Thanks very much for ur help,
But while I run ./nam it doesn't show the GUI:

nam:
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D)}] units
}
bind Li..."

what is this error?

type nam that's enough, nam GUI will be opened.
if you want to run nam <filename>.out

knudfl 02-24-2010 12:26 AM

The error : " [code omitted because of length] ,etc. "
EDIT :
http://www.linuxquestions.org/questi...31-a-801695/#3
...............About the patch 'tk-8.4-lastevent.patch'


After the ns2, nam build : Test both in all different
ways, you can think of. They are supposed to be statically
build, i.e. only using the ns2 "tcl, tk version 8.4.14".

So reinstalling the system tcl ( tk ) version 8.5.7
after the tests should usually do no harm.
.....

Mwandha 02-24-2010 03:30 AM

to run tcl scripts, you can use the command ns...for example if you do have example.tcl you can run it as:
#ns example.tcl
to run nam scripts, you can also run them as:
#nam example.nam

but incase your nam is connected to your tcl script it is better to call it from within your tcl script such as:

exec nam example.nam & so as not to run two scripts. here you will only need to run the tcl scripts and if it does run properly the nam with its GUI will appear at the end so as you test out your example.

regards

NB: i too am a newbie but thanks to the forums you learn alot

Mwandha 02-24-2010 03:39 AM

In case you are installing just package by package, i would advice for you to download ns-allinone 2.33 or depending on the version you want it comes with all the packages you need of ns, nam, tcl, tk this also helps you avoid such errors.

wa1961 02-26-2010 07:33 AM

ns2 and nam
 
Hi all.
I have reinstalled ns2 and it shows me % when I tape ns in the shell.
But I have got the same the problem with the graphic mode. I have tried many times to show an example of simulation but nothing appear.
when I tape nam I always got this msg:

nam:
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D)}] units
}
bind Li..."

Plz help because I need to show an example of simulation to begin working.
Is it necessary to patch ns2?
Thanks and regards.

knudfl 02-27-2010 04:29 AM

Yes, that is odd, nam-1.13 ( or 1.14 ) will not create
a working executable on Fedora 12.
No problems with nam on any other modern Linux.
EDIT : See post # 10.

I just made a test compile of nam-1.14 , no ./install
of the complete ns-allinone-2.34 . ( Is known to work
perfect on Fedora 11.)

Nam is a separate application, any version will do.
Click my name, send an email, and I will attach a
static 'nam' (version 1.14), that works on Fedora 12,
to a return mail. ( filesize = 948 kB ).

Suggest : 1) copy the new nam to /usr/local/bin/
Then it is in your path, and the command nam works.

2) And delete the corrupt nam-1.13/nam
.....

P.S. : I guess, the best ns2 version for Fedora 12 is ns-allinone-2.34 .
Fedora 11 : proplems with version 2.33 . But 2.34 works perfect.
.....

knudfl 03-20-2010 08:37 AM

About the 'nam' issues ..
http://www.linuxquestions.org/questi...king-793115/#9
cd tk8.4.18/
patch -p0 < tk-8.4-lastevent.patch
http://bugs.gentoo.org/attachment.cgi?id=161242
http://bugs.gentoo.org/show_bug.cgi?id=225999
.....

TSE_2011 03-21-2012 03:48 PM

hi Freinds
i install ns-2.34 & leach Protocol in ns2.
i want see out graph leach but i'v this message after enter instruction ns leach.tcl:
couldn't read file "mit/uAMPS/ns-leach.tcl": no such file or directory
while executing
"source.orig mit/uAMPS/ns-leach.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source mit/uAMPS/ns-leach.tcl"
(file "leach.tcl" line 7)
plz help;

hmd_jfr 04-06-2012 01:34 AM

hi! for run ns2 tcl file >>> go to tcl path and
ns tclfilename.tcl
for run Xgraph >>> write run command in TCL file
if dont run Xgraph plz send me email(hmd_jfr@yahoo.com)

TSE_2011 04-06-2012 02:37 AM

when me execute leacltcl.tcl i'v This Message:
Usage: myleach.tcl
mandatory arguments:
[-x MAXX] [-y MAXY]
optional arguments:
[-cp conn pattern] [-sc scenario] [-nn nodes]
[-seed seed] [-stop sec] [-tr tracefile]


???

Farshid 07-02-2013 07:58 AM

xgraph font error
 
hi friend
when i run xgraph
get me this error

"Parameter LabelFont: can't translate `helvetica-10' into a font (defaulting to `fixed')
X Error: BadFont (invalid Font parameter)
Major opcode of failed request: 55 (X_CreateGC)
Aborted (core dumped)"

how can fix it?

knudfl 07-02-2013 09:28 AM

Post # 14, @Farshid : Welcome to LQ.

Is that when you run a command ( $ xgraph file ? )
or is it when you are closing xgraph ?

Which version of Ubuntu are you using ? ?
1) $ cat /etc/issue <Enter>
2) $ uname -m <Enter>

-


All times are GMT -5. The time now is 01:11 AM.