swarm-support
[Top][All Lists]
Advanced

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

EZDistribution problem


From: J. McKenzie Alexander
Subject: EZDistribution problem
Date: Wed, 5 Dec 2001 14:36:01 -0800

I've encountered a problem in implementing an EZDistribution in my model.

ez_distribution and agentSet are global variables, and I know agentSet is
nonempty at the time I initialize the ez_distribution.  Each member of the
agentSet responds to getStrategy, returning an integer between 0 and 7
inclusive.

I create the ez_distribution as follows:

    ez_distribution = [EZDistribution createBegin: [self getZone]];
    SET_WINDOW_GEOMETRY_RECORD_NAME (ez_distribution);
    [ez_distribution setTitle: "Strategy Frequency"];
    [ez_distribution setAxisLabelsX: "Strategy" Y: "Frequency"];
    [ez_distribution setCollection: agentSet];
    [ez_distribution setProbedSelector: M(getStrategy)];
    [ez_distribution setBinCount: 8];
    [ez_distribution setLowerBound: 0];
    [ez_distribution setUpperBound: 7];
    ez_distribution  = [ez_distribution createEnd];

I then arrange for it to be updated at the appropriate time by adding the
appropriate action to the schedule:

  if ( show_graph ) {
      [displayActions createActionTo: ez_graph  message: M(step)];
      [displayActions createActionTo: ez_distribution  message: M(update)];
  }

However, when I run the model, I get the following error:

  address@hidden ultimatum]$ ./ultimatum
  *** event raised for error: OffsetOutOfRange
  *** function: indexAtOffset(), file: Collection.m, line 105
  *** execution terminating due to error
  Symbol.m:173 -[Error(c) _raiseEvent:]
  Aborted (core dumped)

Did I make a mistake in initializing the distribution?  The error goes away
if I comment out the ez_distribution code.

If anyone could offer some help, I'd greatly appreciate it.   In case code
should be of use, a gzipped tarfile can be found at
http://evolve.lse.ac.uk/jalex/misc/ultimatum-buggy.tar.gz.  Note that in
order to activate the distribution code, one needs to make sure that the
radio button for "Display graph" is set to Yes.

Thanks,

Jason

--
J. McKenzie Alexander
Co-ordinator, MSc Philosophy of the Social Sciences
Department of Philosophy, Logic and Scientific Method
London School of Economics and Political Science
Houghton Street
London WC2A 2AE


                  ==================================
   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]