MG Daniels April 19, 2001 >>>> "MM" == Marian Mihalo writes: MM> When I set a "setFileOutput" on value 0 (without saving), my MM> simulation in batch swarm are working correctly. But when I want a MM> save to file, here is a problem -> Segmentation Fault... MM> After it, I identificated, that problem is in : MM> [foodGrapher createSequence: "minerals.output" withFeedFrom: MM> modelSwarm getBugList] andSelector: M(getFoodNumber)]; (Restating Paul...) Is -getFoodNumber a method on a List subclass or on an agent in the list? If it is an ordinary List, then you'd want to use a sequence method like -createAverageSequence:withFeedFrom:andSelector:. Here's an example of the simple sequence usage. #import #import #import @interface Bug: SwarmObject double value; } + create: aZone setValue: (double)value; - (double)nextValue; @end @implementation Bug + create: aZone setValue: (double)theValue { Bug *obj = [self create: aZone]; obj->value = theValue; return obj; } - (double)nextValue { return value += 1.0; } @end int main (int argc, const char **argv) { initSwarmBatch (argc, argv); { id grapher = [EZGraph createBegin: globalZone]; id obj = [Bug create: globalZone setValue: 0.0]; [grapher setGraphics: NO]; [grapher setFileOutput: YES]; grapher = [grapher createEnd]; [grapher createSequence: "out" withFeedFrom: obj andSelector: M(nextValue)]; [grapher step]; [grapher step]; [grapher step]; [grapher drop]; } return 0; } /* Local Variables: compile-command: "PATH=/usr/bin:$PATH $SWARMHOME/bin/libtool-swarm --mode=link gcc -D_GNU_SOURCE -o TestEZGraph -O2 -g -Wno-import -I$SWARMHOME/include/swarm -L$SWARMHOME/lib/swarm TestEZGraph.m -lswarm -lobjc -ldl -lc" End: */