[net.sources.mac] Simutree, Simunet

winkler@harvard.ARPA (Dan Winkler) (03/02/85)

For those of you who asked for these because you can't access sumex,
I'm posting them to net.sources.mac.  I've become interested again in
improving these programs so I'd appreciate your comments.  I'll include
here some of the comments that were sent to info-mac and then in the
next two postings I'll send the actual binhex files.

----------------------------------------------------------------------

Date: Tue, 26 Feb 85 17:10:48 EST
From: winkler@harvard.ARPA (Dan Winkler)

Here are two animated Macintosh programs I've written, MacTree and 
MacNet.  (I'm open for better names.)

[ How about SIMUTREE.HCX and SIMUNET.HCX ? That is how they are
  stored here on <INFO-MAC> -jma ]

MacTree is an animated tree program which is similar to handson except
that it also does AVL trees and self-adjusting trees, not just binary 
trees.  Just type characters to insert nodes.  If you change tree
types without first clearing the nodes in the current tree, it
reinserts the same input sequence into the new tree type.  There is an
undo feature that lets you watch the same insertion several times.
There is an insert random feature that lets you build random trees (it
uses the Random() function in QuickDraw).  You can adjust the speed of
the animation by choosing whether the program should pause, stop, or
continue full speed ahead after each message it prints.  If you choose
stop, the program will wait for a keydown or mousedown before
proceeding.  It counts steps needed for each insertion to give you
some idea of the relative efficiency of each tree type.

MacNet is an animation of Valiant's randomized packet switching 
algorithm which shows packets moving between queues in nodes
positioned at the vertices of a hypercube.  The point of the animation
is that there are permutations which cause very bad traffic jams when
all packets move along the shortest path to their destinations but
that if you send each packet first to a random destination and then
along the shortest path to its real destination, you avoid the traffic
jams.  This program takes a few seconds to start up; be patient.

These programs were inspired by Brown's BALSA system.  MacNet has
never been used for anything except amusing Valiant and me.  MacTree
is being used this semester at Harvard in Computer Science 124, a
course on data structures and algorithms.  Both programs are stable
but far from finished.  MacTree needs 2-3, B, and B* trees, a better
redrawing algorithm, scrolling, and node labels longer than a single
character.  Any other features you can suggest will be considered.  My
current plan is to translate into Clascal before adding new features.

If you want source, you can have it.  It's written in Manx C.

Dan. (winkler@harvard)

------------------------------

binhex files follow in next two postings...