swarm-support
[Top][All Lists]
Advanced

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

Re: graphing a list


From: Paul E Johnson
Subject: Re: graphing a list
Date: Thu, 16 Nov 2000 10:33:47 -0600

Do you mean you want one line for each object?  If you want to do that,
I can tell you how, Sven T told me a while ago. The idea is to create a
sequence for each object being graphed, and then when an object is
created or destroyed, it tells the observer to create (or destroy) its
sequence.  This assumes you've created a thing "stabilityGraph" in your
ObserverSwarm's build objects phase.

-createMembershipSequence: (id) placeholder 
{
  id sequence;
  char sequenceName[10];
  sprintf(sequenceName,"Org. %d",[placeholder getGrpNumber]);
  sequence= [stabilityGraph createSequence: sequenceName
                            withFeedFrom: placeholder 
                            andSelector: M(getMembershipLevel)];        
  return sequence;
}

And when you don't want them graphed any more, do:

-dropMembershipSequence: (id) placeholder 
{
  [stabilityGraph dropSequence:  placeholder];
  return self;
}


I think you may instead want to graph the average across objects, and if
you look in the Heatbugs code there is an example like that.  Your code
snip is creating the wrong kind of sequence if you need an average
rather than a plot for each individual object.

Jonathan Impett wrote:
> 
> Hello -
>     Maybe I'm barking up the wrong tree, but try as a might, I can't
> persuade EZgraph to ask all the members of a list for a value at each
> step.
>     What I want to do, essentially, is:
>             [graph createSequence: "Fitness of melodic cells"
>                          withFeedFrom: [templateModelSwarm
> ***get_the_id_of_the_list_of_cells***]
>                           andSelector:
> M(***get_fitness_of_each_member***) ];
> 
>     The first part works, of course.For the latter, I've tried various
> permutations of parantheses and "forEach" with no success.
>             Thanks,
>     Jonathan
> 
> --
> 
> Jonathan Impett
> Faculty of Music

-- 
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ukans.edu/~pauljohn
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66045                FAX: (785) 864-5700

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