[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CalendarScheduler and "backwards in time"



On Tue, 17 Aug 1999 14:17:23 EDT, Brad Karp wrote: 
>I, too, have encountered the "backwards in time" problem with ns's
>CalendarScheduler. The CalendarScheduler is indeed not reliable for
>long-running simulations with a great many events that are scheduled very
>closely.
>
>...
>
>The latter, however, is not sufficient alone for all simulation run lengths
>and event patterns--the underflow can accumulate more than .5 * width_'s
>worth without control of the choice of width_.
>
>...
>
>I'm preparing a better fix now, and will post code for it shortly. The
>better fix is to keep an unsigned long int count of "bucket hops", and
>periodically set buckettop_ using direct multiplication of width_ * hops_.
>Done occasionally (i.e., every hundred thousand or more bucket hops), this
>will pull buckettop_ back to its true value, and keep the underflow of the
>repeated FP additions from growing without bound.

Thanks for finding this problem, Brad.
Your description and your fix both sound plausible.

   -John Heidemann