Simulation with Erlang
Tue Dec 12 23:05:29 CET 2000
It feels like it should be Friday, but the week is till young *sigh*
As some of you might remember, I am considering to use Erlang in a robotics
application. Since the hardware is way too expensive (unless I find a
good-hearted sponsor!) I thought I'd try to simulate it with a program. So
far so good.
The problem I stumbled upon is how to handle simulation time. My thought was
to have processes run free, and a supervisor one (the "world") to check on
them and collisions and such. But that is a completely different paradigm
than the one I used before (the "objects" are run in the "world" thread,
under it's control) and I can't make it work.
More precisely, the Erlang multitasking strategy gives no control over when
to yield execution. An Erlang "timeslice" might include very different
lengths of "simulation time".
A solution I came up with is to have the world doing the synchronization by
sending "tick" messages to each object. But that gives a lot of traffic! And
it's not elegant at all.
Can anyone give me some hints of whether it is possible to synchronize
everything in a clean way, and if yes, how? Or at least some pointers for
where to look further.
thanks in advance,
Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com
More information about the erlang-questions