Google

The Camel Distribution

Written on:October 5, 2008
Comments
Add One

Long time ago, before the internet era, I was working on my PhD in the field of distributed event-driven simulation. One of the key questions was how to manage the event time line. The pitch in this case is that the time line is distributed.

To be more precise; a simulation event time line is a priority queue, where event notices are inserted during the processing of one event. By definition, events are posted to a future point in simulated time. Distributed event-driven simulation, means that several processors are processing events, where each event emits new future events. Whenever an event is processed the simulated time is incremented monotonically. If several events are processed in parallel, it means the simulated time is blurred between the earliest and the latest time points of the events being processed. The trick is to ensure no new emitted event falls within this blurred time interval. Becuase, time cannot move backwards.

The time line was implemented using varius priority-queue implementations, suitable for execution on a multi-processor. I was especially interested in the performance of my implementation of a distributioned version of the Calendar queue .

During my tests I realized the need to emulate bursty traffic, i.e., burts of insertions of events into the time line priority queue. I couldn’t find a suitable stochastic distribution, that easily could module bursts. Like, “give me five bursts, over the distribution interval”.

I played around with several different stochastic distributions for random number generation, without finding a simple to use distribution with the property stated above. This inspired me to design a distribution myself, which was named the Camel distribution, because of the humps. A Camel distribution is a composition of one or more Dromedary distributions. A Dromedary distribution has one single hump.

The Camel distribution paper was published in 1991 and have been in use in various computer simulation projects ever since.

My first implementation for random number generation based on the Camel distribution was in C, because that was the language I used for my research. The implementation here is in Java. However, it is very easy to implement the algorithm in some other language. Based on the Java code or straight from the source. More information can be found here.


Leave a Comment

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Why ask?