Discrete event/agent based simulation

diegogomezdeck at consultar.com diegogomezdeck at consultar.com
Wed Oct 1 14:14:28 UTC 2003


Dear Simon,

> Dear Squeak list,
>
> I'm new to Squeak/SmallTalk, and I've found the best way (for me) to
> learn  about an OO language is to implement a discrete event
> simulation. I've been  looking for resources in this vein, and I wonder
> whether anyone has any  other pointers.
>
> For a basic DES, one needs the following:
>
> 1. A random number generator

Random class is not a bad starting point.  We used in Microcosms.

> 2. A scheduler
>
> My other implementations of DES (in Python and in Eiffel,
> incidentally),  keep sorted timestamps in a balanced binary tree
> (either an AVL tree or a  Red-Black tree). Are there Collections that
> implement such data structures?

This point is, in my eyes, one of the good points in Smalltalk.  Most of
the times you don't care about the internals but the external view of the
collection.  In Smalltalk is more important to say aBag, aSet,
anOrderedCollection, etc than to say aTree, aLinkedList, etc.

If you need order then use SortedCollection, how the  SortedCollection
keeps the elements is its business.  If *and only if* you have performance
problems you can use the most difficult to learn pattern: replace an object
with another.  If you find that SortedCollection is not enough for your
needs, replace it with YourTypeOfSortedCollection without changing the rest.

> It's also nice to have some GUI input/output. Specifically, is there a
> standard plotting library that people use?

See PlotMorph (http://minnow.cc.gatech.edu/squeak/2626) and PieChartMorph
(http://minnow.cc.gatech.edu/squeak/2624).

> My simulations often involve networks. Are there any nice packages for
> storing, displaying, and analyzing graph structures? (I've seen some on
>  SqueakMap, but I haven't tried them out yet).

To visualize graphs you *must* use Ned's Connectors.

> Some nice vector
> graphics  routines for animating graphs would be nice too.
>
> I've also had a look at Microcosms
> (http://www.agro.uba.ar/microcosms/),  which is very interesting, and I
> wonder how much of my models could be  built into this.

I'm not sure I understand exactly your requirements. Microcosms is a type
of StarSqueak (so StarLogo) framework.

> Thanks for any feedback
> Simon

Cheers,

Diego





More information about the Squeak-dev mailing list