[Ns-developers] Comment on ns Simulator::Schedule (re-post to ns-developers)
Tom Henderson
tomh at tomh.org
Mon Nov 20 21:14:43 PST 2006
George Riley wrote:
>
> I can't understand why the time passed to schedule is absolute time as
> opposed to relative time. The expected use case is that the time
> calculated
> is relative to current time (transmission time, speed of light delay,
> time out values
> in TCP, etc). The only absolute time use case is if we want an
> application to
> start at some particular time, or the simulation to finish at some
> time. I think
> we need to optimize for the expected case, and say:
>
> Schedule(rxTime, .....) // Schedule packet rx event
>
> and
>
> Schedule(myAppStartTime - Now())
>
> when the abs time is needed.
>
George and Mathieu,
I am fine with switching this to relative time, since it is relative in
ns-2 and might make for a more readable port of code, and since relative
event timing is probably more frequent than absolute.
This was suggested also by tommaso originally in this thread; forgive me
for losing track if there was a reason cited to move to absolute.
Tom
More information about the Ns-developers
mailing list