swarm-support
[Top][All Lists]
Advanced

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

Re: Question about how to make EZGraph do what I want


From: Sven N. Thommesen
Subject: Re: Question about how to make EZGraph do what I want
Date: Sun, 23 Aug 1998 19:45:51 -0500

At 04:18 PM 8/21/98 -0500, you wrote:
>Hello, everybody.  
>
>I have an EZGraph that collects information and plots a line for
>each "recruiter" in the "recruiterList".  Each line shows the number
>of members in that recruiter's membership (getMembershipLevel).  The
>code is attached below.
>
>The problem is that this code executes at time 0, and so when
>recruiters are born and killed, they do not drop out or pop into
>the graph.  Life would be nicer for me if they did.  
>
>Got an idea what ought to be done?
>
>    stabilityGraph = [EZGraph createBegin: [self getZone]];
>    SET_WINDOW_GEOMETRY_RECORD_NAME (stabilityGraph);
>    [stabilityGraph setTitle: "Membership"];
>    [stabilityGraph setAxisLabelsX: "time" Y: "Total Membership"];
>    stabilityGraph = [stabilityGraph createEnd];
> 
>    for(i=0; i < [[modelSwarm getRecruiterList] getCount]; i++){
>      id aRecruiter;
>      aRecruiter = [[modelSwarm getRecruiterList] atOffset: i];
>    
>      [stabilityGraph createSequence: "Membership"
>                           withFeedFrom: aRecruiter 
>                           andSelector: M(getMembershipLevel)];
>    }

Paul (and others):

I have patched EZGraph to allow you to do what you want. I have submitted
the patch to Marcus, who (cross your fingers) will fold it into the
imminent Swarm-1.3.

The change will be:
a) when a recruiter is 'born' and you want to add him to the graph, you say:

   id mySeq;
   mySeq =      [stabilityGraph createSequence: "Membership"
                           withFeedFrom: aRecruiter 
                           andSelector: M(getMembershipLevel)];

b) your program needs to save mySeq and associate it with the given
recruiter object (for example, let the recruiter keep it in an instance
variable).

c) when you get ready to kill off a recruiter agent, you delete his
sequence from the graph by saying 

        [ stabilityGraph dropSequence: mySeq ];

where mySeq has been given the value remembered by the recruiter in step (a).

Cheers,
Sven


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