swarm-support
[Top][All Lists]
Advanced

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

Re: yet another Map question


From: Ken Gosier
Subject: Re: yet another Map question
Date: Sun, 22 Oct 2000 12:42:02 -0400

Paul E Johnson wrote:
> 
> I believe you are right.  Are you just asking for general purposes or
> has something gone wrong that made you ask?
> 


Quick explanation of who I am and what I'm doing, in 250,000 words or
less ;-)

I'm a researcher at a financial firm in Boston. I've downloaded the code
for Artificial Stock Market, and I'm currently trying to see if I can
generalize the code, to have
   - several assets in the world
   - different types of agents, including an "Investor" agent, something
like a
     mutual fund manager, which applies a CAPM-style analysis.
     (For this, it's necessary to have several assets, as CAPM is
     inherently cross-sectional in nature.)

Two caveats with what I'm attempting:
   - I'm doing this on my own time outside of work; this approach may be
too
     'radical' for my boss.
   - I have yet to see whether or not I'll have any success with this
effort.


About the Map questions:

My first question was just about what data types are employed for the
keys and vals in the Map. I do a lot of perl programming, where the
analogy is a hash variable, and the keys and vals are both of the
'scalar' type. So I just wanted to make sure I understood what was going
on there.


The 2nd question was for how to set up the map; I don't have anything
running yet that might break. ;-)

Basically, in the ASM, each Bit-Forecasting agent has a set of
'foreCasters' which he may use to foreCast the price next time period.
In the current ASM, there is only 1 asset, so this may just be stored as
a List.

In a world of many assets, the Bit-Forecasting agent must keep a
different list for each asset. I thought a Map would be a good way to
handle this, where:
   - the keys are the asset objects
   - the vals are the foreCasterLists


One further question:

While I'm iterating through the Map: Say I don't care about modifying
the contents of the keys, but I do need to access those contents. May I
then just use the format:

for (val=[mapIndex next: key]; [mapIndex getLoc]==Member;
     val=[mapIndex next: key])

That is, without having to say &key ?


Thanks once again--

Ken Gosier
address@hidden

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

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