Hi, Did you check the TCL binding in the C++ part? The new class should have a new binding, not the same one as declared for drop-tail.
Regards, Ilyes Gouta. Eduardo J. Ortega wrote: > hi: > > Don't know if you received my last email, so I'll just write you again: > > I already have the OTCL binding in my newQueue.h file. My sims define the > queue like this: > $ns duplex-link $n1 $n2 1Mb 10ms DropTail (this works) > but when i try to use my queue then i do > $ns duplex-link $n0 $n2 1Mb 10ms newQueue > which doesn't work. > > I'm pretty sure this can't be a code problem, since I've copied and pasted > drop-tail.{cc,h} to newQueue.{cc,h}, changed classes names and recompiled but > still won't work. Can you think of anything else I might be doing wrong? > Thanks in advance. > > On Saturday 29 April 2006 16:06, you wrote: >> Hi, >> >> You have to create the necessary TCL binding within your new C++ code >> too. That binding will be used later by your simulation scripts. >> >> In the C++ part, you'll have to add a class like this: >> >> static class NewQueueClass : public TclClass >> { >> public: >> NewQueueClass () : TclClass("Queue/NewQueue") {} >> TclObject* create(int, const char*const*) >> { >> return (new NewQueue); >> } >> } class_new_queue; >> >> And then in the simulation script: >> >> $ns node-config \ >> option1 \ >> option2 \ >> option3 \ >> -ifqType Queue/NewQueue \ >> >> This will tell NS to use your new queue for the newly created nodes. >> >> Hope it helps, >> Ilyes Gouta. >> >> On 4/29/06, Eduardo J. Ortega <[EMAIL PROTECTED]> wrote: >>> Hi: >>> I tried this, recompiled ok, but my sims won't run no matter what my code >>> is. i thought maybe my code was wrong, so i decided to copy >>> droptail.{cc,h} to fifo.{c,h}and change class names to FIFO, then add >>> fifo.o to makefile and recompiile. It compiled, but again, sims won't run >>> when i try to use fifo instead of droptail. >>> >>> Any clues? >>> >>> On Saturday 29 April 2006 11:11, you wrote: >>>> Hi, >>>> >>>> Have a look into the ~/ns-2.x/queue directory. You'll find all sorts >>>> of implementations for different active queues. This include RED, RIO, >>>> PRIO, JOBS, etc. >>>> >>>> Implementing a new queue is rather easy actually, you'll have to >>>> inherit from Queue and implement the enque() and deque() methods. This >>>> is really it! Don't forget to add you source code to NS's makefile to >>>> get it compiled. >>>> >>>> Regards, >>>> Ilyes Gouta. >>>> >>>> On 4/29/06, Eduardo J. Ortega <[EMAIL PROTECTED]> wrote: >>>>> hey there: >>>>> >>>>> anyone knows how to code new queue algorithms into NS? (for example, >>>>> choke)? Thanks. >>>>> >>>>> -- >>>>> Eduardo J. Ortega - Linux user #222873 >>>>> "No fake - I'm a big fan of konqueror, and I use it for everything." >>>>> -- Linus Torvalds >>> -- >>> Eduardo J. Ortega - Linux user #222873 >>> "No fake - I'm a big fan of konqueror, and I use it for everything." -- >>> Linus Torvalds >