LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   invalid command name "Agent/Antnet" (https://www.linuxquestions.org/questions/linux-newbie-8/invalid-command-name-agent-antnet-4175597660/)

keerat 01-17-2017 12:21 PM

invalid command name "Agent/Antnet"
 
invalid command name "Agent/Antnet"
while executing
"Agent/Antnet create _o36 _o10"
invoked from within
"catch "$className create $o $args" msg"
invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
delete $o
return ""
}
global errorInfo
error "class $..."
(procedure "new" line 3)
invoked from within
"new Agent/Antnet $n0"
invoked from within
"set nn0 [new Agent/Antnet $n0]"
(file "simpleant.tcl" line 27)

TB0ne 01-17-2017 12:23 PM

Quote:

Originally Posted by keerat (Post 5656273)
invalid command name "Agent/Antnet"
while executing
"Agent/Antnet create _o36 _o10"
invoked from within
"catch "$className create $o $args" msg"
invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
delete $o
return ""
}
global errorInfo
error "class $..."
(procedure "new" line 3)
invoked from within
"new Agent/Antnet $n0"
invoked from within
"set nn0 [new Agent/Antnet $n0]"
(file "simpleant.tcl" line 27)

Read the "Question Guidelines" link in my posting signature.

We can't (and won't) guess as to what you're talking about here. All you posted is an error dump, and told us NOTHING about your system, hardware, what you're trying to do, with what software, and when you get that message.

Post details and we can try to help.

keerat 01-17-2017 10:01 PM

invalid command name agent/antnet
 
hi,i am working in ns2.35 and ubuntu version 16.04

i am implementing antnet colony algorithm. i have patched antnet and ./configure and make command run successfully. but when i am trying to run tcl file simpleant.tcl it shows this error. plz help me

invalid command name "Agent/Antnet"
while executing
"Agent/Antnet create _o36 _o10"
invoked from within
"catch "$className create $o $args" msg"
invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
delete $o
return ""
}
global errorInfo
error "class $..."
(procedure "new" line 3)
invoked from within
"new Agent/Antnet $n0"
invoked from within
"set nn0 [new Agent/Antnet $n0]"
(file "simpleant.tcl" line 27)

rtmistler 01-18-2017 06:36 AM

You've done little more here by way of description.

Firstly, any code or outputs you post should be within [code][/code] tags to make it more readable.

Any source scripts which you are referencing or have created, you should post to enhance your question.

Those errors by the way cite line numbers in tcl scripts. Are you looking at those lines to see what they say? You should post the tcl scripts in question where the errors are being found.

keerat 01-18-2017 10:57 AM

i am getting error on runnig this tcl script
 
# tcl script for AntNet algorithm on an arbitrary topology of 12 nodes

#number of nodes
set sz 2

#Create event Schedular
set ns [new Simulator]

#Open the Trace file
set tf [open simple.out w]
$ns trace-all $tf

# nam trace initialization
#set namtrace [open sooa-out.nam w] ; # for wireless traces
#$ns_ namtrace-all-wireless $namtrace $val(x) $val(y)
set nf [open simple.nam w]
$ns namtrace-all $nf

#Create 12 nodes
set n0 [$ns node]
set n1 [$ns node]
#Create links between the nodes
$ns duplex-link $n0 $n1 512Mb 155ms DropTail

#Create Antnet agents
set nn0 [new Agent/Antnet $n0]
set nn1 [new Agent/Antnet $n1]

#Attach each node with Antnet agent
$ns attach-agent $n0 $nn0
$ns attach-agent $n1 $nn1

#Create connection between the nodes
$ns connect $nn0 $nn1
#Add neighbors
$ns at now "$nn0 add-neighbor $n0 $n1"
# Set parameters and start time
$nn0 set num_nodes_ 10
$nn0 set timer_ant_ 0.03
$nn0 set r_factor_ 0.001
$ns at 1.0 "$nn0 start"
$nn1 set num_nodes_ 10
$nn1 set timer_ant_ 0.03
$nn1 set r_factor_ 0.001
$ns at 1.0 "$nn1 start"
#Set stop time for AntNet algorithm
$ns at 10.8 "$nn0 stop"
$ns at 10.8 "$nn1 stop"

#Print routing tables generated by AntNet
$ns at 10.9 "$nn0 print_rtable"
$ns at 10.9 "$nn1 print_rtable"
proc Finish {} {
global ns tf nf
$ns flush-trace
close $nf
#Close the Trace file
close $tf
exit 0
}
$ns at 14.0 "Finish"
# Start the simulator
$ns run

TheEzekielProject 01-18-2017 11:31 AM

Dude.
1) As already mentioned: CODE TAGS
2) I doubt many people here are wanting to count out code lines here either.
3) You're not doing yourself any favors here by showing little to no effort

keerat 01-19-2017 07:45 AM

error:- no-slot{} default handler
 
i have solved my first error of invalid command agent/antnet. my tcl file is running but now when i am running another file ant1.tcl i am getting another error.

kiran@kiran-HP-Pavilion-dv6-Notebook-PC:~/ns-allinone-2.35/ns-2.35$ ns235-antnet new1.tcl
--- Classfier::no-slot{} default handler (tcl/lib/ns-lib.tcl) ---
_o21: no target for slot -1
_o21 type: Classifier/Hash/Dest
content dump:
classifier _o21
0 offset
0 shift
1073741823 mask
1 slots
slot 3: _o401 (Classifier/Port)
-1 default
---------- Finished standard no-slot{} default handler ----------

TB0ne 01-19-2017 01:47 PM

Quote:

Originally Posted by keerat (Post 5657292)
i have solved my first error of invalid command agent/antnet. my tcl file is running but now when i am running another file ant1.tcl i am getting another error.

kiran@kiran-HP-Pavilion-dv6-Notebook-PC:~/ns-allinone-2.35/ns-2.35$ ns235-antnet new1.tcl
--- Classfier::no-slot{} default handler (tcl/lib/ns-lib.tcl) ---
_o21: no target for slot -1
_o21 type: Classifier/Hash/Dest
content dump:
classifier _o21
0 offset
0 shift
1073741823 mask
1 slots
slot 3: _o401 (Classifier/Port)
-1 default
---------- Finished standard no-slot{} default handler ----------

Thank you for AGAIN ignoring what you're told. We've asked you several times now to use CODE tags, and post a follow up/clear question. You have done neither. Unless you're going to participate in the conversation, answer questions when asked, and use CODE tags, there's not much point in posting.

keerat 01-23-2017 07:58 AM

which code tags am missing
 
sir, m not getting u which code tags are u talking about? i am implementing antnet colony optimization and i have run several tcl files. but in some tcl file i am getting error. i have posted this error here. can u provide one example. what kind of tags am missing.

pan64 01-23-2017 08:07 AM

code tags mean: use [code]here comes your code[/code] to keep formatting and make your post readable.

keerat 01-23-2017 08:23 AM

like this ??
 
[]--- Classfier::no-slot{} default handler (tcl/lib/ns-lib.tcl) --- [/]
[] _o27: no target for slot -1 [/]
[] _o27 type: Classifier/Hash/Dest [/]
[] content dump: [/]
[] classifier _o27 [/]
[] 0 offset [/]
[] 0 shift [/]
[] 1073741823 mask [/]
[] 1 slots [/]
[] slot 5: _o403 (Classifier/Port) [/]
[] -1 default [/]
[] ---------- Finished standard no-slot{} default handler ---------- /code]

pan64 01-23-2017 08:28 AM

no, insert [code] before your text and [/code] after that. Without modification, only once.
please try to edit to last post to see the result

rtmistler 01-23-2017 08:28 AM

Quote:

Originally Posted by keerat (Post 5659014)
[]--- Classfier::no-slot{} default handler (tcl/lib/ns-lib.tcl) --- [/]
[] _o27: no target for slot -1 [/]
[] _o27 type: Classifier/Hash/Dest [/]
[] content dump: [/]
[] classifier _o27 [/]
[] 0 offset [/]
[] 0 shift [/]
[] 1073741823 mask [/]
[] 1 slots [/]
[] slot 5: _o403 (Classifier/Port) [/]
[] -1 default [/]
[] ---------- Finished standard no-slot{} default handler ---------- /code]

Recommend you use the Advanced Edit mode.

There is a # symbol in the tools for that mode. Select your code, and then click the # symbol in the menu to convert the selection to be tagged as code.

TB0ne 01-23-2017 08:30 AM

Quote:

Originally Posted by keerat (Post 5659002)
sir, m not getting u which code tags are u talking about? i am implementing antnet colony optimization and i have run several tcl files. but in some tcl file i am getting error. i have posted this error here. can u provide one example. what kind of tags am missing.

Again, read the LQ Rules; pay attention to the parts about text-speak and NOT using it. The CODE tags are, as you post, available by selecting a block of text with your mouse, and clicking the "#" just above the box you're typing in.

rtmistler 01-23-2017 08:35 AM

Note that what you really need to do is post the script: ns235-antnet new1.tcl

You've posted the error, however this is only part of the information.


All times are GMT -5. The time now is 12:23 AM.