Simulator design question

Stephan B. Wessels swessels at sdrc.com
Fri Sep 7 13:59:34 UTC 2001


Well,

It sounds like you are building a Network of Nodes... (hint hint)

As Ned suggested you could use a class variable, or maybe another 
instance to hold the network itself with that instance having network 
specific behavior.  As each node gets created it could get added to the 
Network instance and have a unique access mechanism within that network.

Just some ideas...

Have fun!

  - Steve

On Thursday, September 6, 2001, at 06:38 PM, david at aminal.com wrote:

> Slowly but surely, I'm trying to put together the basics for my
> network simulator. The pointers to the blue book helped, but
> much of what I want to do is very different from the examples.
>
> My first stumbling block (it didn't take very long <g>) is how
> to model the network nodes. Each instance of a Node needs it's
> own unique identifier, and needs to communicate with other specific
> nodes. Nodes generate this id at the time the instances are created.
>
> So, I guess my question is , how do I make my Node instance known to
> the rest of the Smalltalk environment by its unique identifier? Is it
> possible to create global variables on-the-fly?
>
> In a workspace it seems so simple,
>
> uniqueID1 := Node new.
> uniqueID2 := Node new.
>
> etc.
>
> But I don't see how to do this in a 'new' method, where the variable 
> name
> is generated and then pointed at the resulting instance.
>
>
> Any suggestions greatly appreciated :-)
>
>
> David Schutt
>
>
>
>
>
>
>
>
>


--
Books are not made for furniture, but there is nothing else that so 
beautifully furnishes a house. Henry Ward Beecher




More information about the Squeak-dev mailing list