swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Copy and initSeed


From: Benedikt Stefansson
Subject: Copy and initSeed
Date: Mon, 02 Dec 1996 00:01:30 -0800

Hi there,

I'm stumped on two questions which probably are pretty basic, but
the docs make me thoroughly confused. Hope someone can help out because
this is stalling my sim at the moment:

1) I need to copy an instance on the fly, i.e. have an object
instance create a copy of itself and return the id (then I will
pass messages to the instance to change some variables which 
should not change in the parent.)

I see in the defobj docs that there is a message copy: aZone on par with
drop,create and such, but how do I inherit it? It doesn't seem to
be inherited with the Swarm superclass. Should I subclass from
some other class or what?

2) If I want to initalize a random distribution with a seed (e.g. 
uniformRandom), and have all objects that need a random number
call this same instance of the distribution, can I simply
initialize a generator for uniformRandom in the ModelSwarm? 

I guess my question boils down to 'where does that nifty uniformRandom
instance come from?' The fact that one doesn't have to create the
uniformRandom instance explicitly and gets it 'for free' is pretty nice,
but at the same time leaves one in the dark pretty much with regard to
how one controls intialization and access.

Hope everyone is back relaxed and well fed after the holidays,

-Benedikt. 

----------------
Benedikt Stefansson                 address@hidden
Center for Computable Economics     Tel. (310) 825-1777
Department of Economics, UCLA       Fax. (310) 825-9528
Los Angeles, CA 90095-1477          http://cce.sscnet.ucla.edu


reply via email to

[Prev in Thread] Current Thread [Next in Thread]