[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ns] Strange DiffServ Result.
try in this way:
1. define in class dsREDQueue, private section:
int phisQueueLimit[MAX_QUEUES];
2. redefine qlim inizialization in method reset in this way:
for (i = 0; i < MAX_QUEUES; i++)
redq_[i].qlim =
((phisQueueLimit[i]==0)?limit():phisQueueLimit[i]);
3. define setQsize metho in this way:
void dsREDQueue::setQSize(int queueNum, int qMaxSize) {
if(queueNum < MAX_QUEUES) redq_[queueNum].qlim =
phisQueueLimit[queueNum]=qMaxSize;
else printf("The queue number is out of range.\n");
4. add to command method this (as you already have done, I think):
if (strcmp(argv[1], "setQSize") == 0) {
setQSize(atoi(argv[2]),atoi(argv[3]));
return(TCL_OK);
}
In this way it should work. Whenever Reset is called, for redefined
queue limit it will be assigned the new value; for the others, the
default value.
Regards,
Sergio
Sungwon Yi wrote:
>Hi, I thanks for the reply.
>The statement redq_[i].qlim = limit() assign the default queue length
>to each physical queue, so I modified this.
>The values got from the user is assigned istead.
>If this is moved to constructor, the values can not be visible to
>program, because this object is created first and the 'command'
>is called.
>
>As you said, reset is called 2 times in simulation.
>first is constructor and before the actual start of the simulation.
>Sorry, I also do not know where it is exactly. However, It is called.
>
>Is there anyone who tried to change the queue length?
>
>Best regards.
>Sungwon.
>
>======================================
>Yi, Sungwon
>Have a wonderful day!
>======================================
>
>