swarm-support
[Top][All Lists]
Advanced

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

removeProbeDisplayFor question/problem


From: Rick Riolo
Subject: removeProbeDisplayFor question/problem
Date: Fri, 15 Nov 1996 07:52:30 -0500 (EST)

Hi,
I have the following method which I hoped would allow
a user mouse click a method in a observer level probe to bring up probes 
into a bunch of agents, and then to mouse click it again
to get rid of all those probes.
The createProbeDisplayFor (see below) works fine...I get all the probes.
But when I press it again, instead of having the probes
all removed, I get a core dump.

Before get into gpb, I thought I'd ask if I'm not
using the removeProbeDisplayFor correctly.

Thanks for any suggestions!
 - r

-toggleProbeAgents {
        id              agnt, index;

        if ( ![modelSwarm getAgents] ) {
                printf("\nYou can't probe until agents created on first 
step!\n");
        }
        else if ( probeAgents ) {       // got some probes, so remove them all
                probeAgents = 0;
                index = [[modelSwarm getAgents] begin: scratchZone];
                while ( (agnt=[index next]) ) {
                        [probeDisplayManager removeProbeDisplayFor: agnt];
                } [index dropFrom: scratchZone];
                index = [[modelSwarm getShippers] begin: scratchZone];
                while ( (agnt=[index next]) ) {
                        [probeDisplayManager removeProbeDisplayFor: agnt];
                } [index dropFrom: scratchZone];
        }
        else  { // no probes yet, but we have agents, so probe them all
                probeAgents = 1;
                index = [[modelSwarm getAgents] begin: scratchZone];
                while ( (agnt=[index next]) ) {
                        [probeDisplayManager createProbeDisplayFor: agnt];
                } [index dropFrom: scratchZone];
                index = [[modelSwarm getShippers] begin: scratchZone];
                while ( (agnt=[index next]) ) {
                        [probeDisplayManager createProbeDisplayFor: agnt];
                } [index dropFrom: scratchZone];
        }
        return self;
}

Rick Riolo                       address@hidden
Program for Study of Complex Systems (PSCS)
1061 Randall Lab     University of Michigan
Ann Arbor MI 48109-1120
http://pscs.physics.lsa.umich.edu/PEOPLE/rlr-home.html



reply via email to

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