swarm-support
[Top][All Lists]
Advanced

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

Complex Spaces (Lattice) Code Examples


From: Benedikt Stefansson
Subject: Complex Spaces (Lattice) Code Examples
Date: Fri, 14 Mar 1997 17:22:39 -0800

Sven, John, Glen et al:

This is a followup to todays discussion of how to implement
2D Spaces with complex information at each site.

I tarred up my examples of 'complex' lattice spaces and threw
together a quick and dirty README. For those who don't want to 
untar the files to see if they are interested, below is a terse
description of what these classes are supposed to accomplish.

I have also been meaning to write up 3-4 'Stupid SwarmTricks' 
factsheets based on writing these classes and recent experiences,
but you know how time flies when you are having fun debugging.

You should find a Space.tar.gz file attached to this e-mail message.
Let me know if that doesn't work.

Here goes The README (if you are not interested bail out now):

This version: 3/14/97. From ProductSwarm V0.8
------------------------------------------------------------------------

These code examples are provided as a public service. The 
objects are a part of a simulation of competition oligopolistic
firms, where products are imperfect substitutes. 

Goods are defined as a bundle of two arbitrary characteristics x and y.
The amount of each characteristic in the bundle maps into
a location on a 2D discrete lattice. Consumers hold preferences
for all the goods, but prefer a particular bundle over all others
and are less willing to pay for any other good.

Enclosed are the following examples of 2D discrete spaces with 
complex data objects associated with each x,y location:

DemandSpace: 

Registers only the demands at each price for each location on 
the lattice. To accomplish this a sorted map is defined for each
location, a _PriceData_ instance is used as a key value for each
price that occurs and an associated _DemandData_ object holds the 
actual demand data (number of units demanded). Both _PriceData_ and
_DemandData_ are constructed so that they can respond to requests
for their data. DemandSpace can also print out demand curves for
each location in 'ASCII Art' format.


It is fairly straightforward to change DemandSpace so that the 
DemandData object holds pointers to all the consumers that would be 
willing to buy the product at the associated price. This could be
useful to calculate effective demands facing firms in sequential
market games. (Relics of this code are actually still in the 
DemandSpace.m code commented out)

MarketSpace: 

Registers trades and prevalent prices at each location on the lattice
for each time step. To accomplish this a _MarketData_ instance is
created to hold data at each location and respond to requests for
various
data (such as transactions in the last period, current number of units
transacted, prices at t-1 and t etc.)

OfferSpace:

Registers outstanding price offers at each location and accepts new
offers if the offered price is lower than the prevalent price. To 
do this an _OfferData_ object is associated with each location.
Consumers
also can call OfferSpace and get the best good available to them
contingent on their reservation price and current offers.

------------------------------------------------------------------------
END OF README

Hope this proves useful to someone. Comments, criticisms and bug 
reports for this code would of course be appreciated.

Regards,
-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

Attachment: Spaces.tar.gz
Description: GNU Zip compressed data


reply via email to

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