954,504 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Having problem in writting simulation on Random Early Detection (RED) using C++

Hello:

I am writting a simulation code on Random Early Detection (RED) and when i run the simulation , the average delay is too high. Does anybody have some idea on it.I really can't get along with it now withouth any help . :cry: Please help me!!!!!!!!!!!!!

I have upload the coding of mine. The file name called sim12.cpp.

Hope will get reply soon... through my email - email removed by moderator

Attachments sim12.CPP (8.52KB)
leelingling630
Newbie Poster
1 post since Jan 2005
Reputation Points: 10
Solved Threads: 0
 

hi!
i also do that. you can send it to me, ok? modified simulation code or code!
thank!

taptanh
Newbie Poster
1 post since Aug 2008
Reputation Points: 10
Solved Threads: 0
 

You have a rather strange code to generate exponential distribution. Use RAND_MAX macros from (it's not equal to the funny pow expression).

const double max_rand = RAND_MAX;
...
...   log (x/max_rand) ...

With 32-bit compilers you have huge intervals because of (usually) RAND_MAX is equal 32767 only (rand() is a very bad pseudorandom numbers generator ;))...

Alas, I have no time to inspect your code more carefully now.

ArkM
Postaholic
2,001 posts since Jul 2008
Reputation Points: 1,234
Solved Threads: 348
 

> Alas, I have no time to inspect your code more carefully now.
Take your time, it was posted (and abandoned) on 8th Jan 2005

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

What's a nightmare!..
Thank you, Salem ;)

ArkM
Postaholic
2,001 posts since Jul 2008
Reputation Points: 1,234
Solved Threads: 348
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You