scheduling order

"Marcin Pilat" <[email protected]>
Newsgroups gmane.comp.breve
Message-ID <000001c3c401$4378afa0$6401a8c0@dabear>
Hello.

 

I'm not sure whether this is a bug or a feature but I noticed behaviour
of the function call scheduler that might not be appropriate in many
simulations.  The scheduler seems to change the evaluation order of
function calls.  Below is an example:

 

Suppose we have a set of mobile objects with neighbour information.
Each object has a method called RunMe which gets called from a
RunMeFirst method.  Now, suppose an object calls the RunMeFirst method
of all its neighbours.  We have 2 cases:

 

Direct call:

If RunMeFirst directly calls the RunMe method, then obviously the
evaluation order of the objects' RunMe method is preserved based on the
RunMeFirst method.

 

Schedule call:

If RunMeFirst calls the scheduler to schedule the RunMe method after a
fixed time (eg. 1) then the evaluation order of RunMe is independent on
the evaluation order of RunMeFirst.

 

Thus, if you need to preserve the evaluation order with scheduled
methods, then you need to create your own time keeping and provide time
checking in the init function and then call RunMe after that time.  This
seems to work and preserve the calling order.

 

Marcin

_______________________________________________
breve mailing list
[email protected]
http://www.spiderland.org/mailman/listinfo/breve
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.