[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Histogram
From: |
Marcus G. Daniels |
Subject: |
Re: Histogram |
Date: |
22 Jun 1999 13:15:25 -0700 |
User-agent: |
Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.3.10 |
>>>>> "MM" == Matthew M Murphy <address@hidden> writes:
MM> Just wondering if anyone can tell what I've done wrong
What does this program do that you don't expect?
#import <simtools.h>
#import <gui.h>
#import <objectbase/SwarmObject.h>
@interface Controller: SwarmObject
{
id syntaxHistogram;
}
- createEnd;
- (void)draw;
@end
@implementation Controller
- createEnd
{
// create a histogram depicting syntax "bits" across the population
syntaxHistogram = [Histogram createBegin: [self getZone]];
[syntaxHistogram setNumBins: (int)36];
syntaxHistogram = [syntaxHistogram createEnd];
[syntaxHistogram setWidth: 500 Height: 250];
[syntaxHistogram setTitle: "Syntax Bit Distribution"];
[syntaxHistogram setAxisLabelsX: "each parameter" Y: "agents with param"];
[syntaxHistogram pack];
return self;
}
- (void)draw
{
double values[36] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0,
1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0,
1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0,
1.0, 2.0, 3.0, 4.0, 5.0, 6.0 };
[syntaxHistogram drawHistogramWithDouble: values];
}
@end
int
main (int argc, const char **argv)
{
id controller;
initSwarm (argc, argv);
controller = [Controller create: globalZone];
[controller draw];
while (1) { while (GUI_EVENT_ASYNC ()) {} }
}
/*
Local Variables:
compile-command: "/opt/gnu/bin/gcc -o histogram -g -Wno-import
-L/opt/SUNWtcl/8.0/sun4/lib -R/opt/SUNWtcl/8.0/sun4/lib -L/opt/SDGblt/2.4g/lib
-R/opt/SDGblt/2.4g/lib -L/opt/SDGlibffi/1.20/lib -R/opt/SDGlibffi/1.20/lib
-L/opt/SDGswarm/1.4.1/lib -L/opt/SDGzlib/1.1.3/lib -L/usr/local/X11/lib
-R/usr/local/X11/lib -L/usr/openwin/lib -R/usr/openwin/lib
-L/opt/SDGhdf5/1.0.1/lib -I/opt/SDGswarm/1.4.1/include histogram.m -lanalysis
-lsimtools -lsimtoolsgui -lactivity -ltkobjc -lrandom -lobjectbase -ldefobj
-lcollections -lmisc -ltclobjc -ltk8.0 -ltcl8.0 -lBLT -lsocket -ldl -lnsl
-L/usr/openwin/lib -lhdf5 -lpng -lz -lXpm -lX11 -lffi -lm -lobjc -lpthread
-lposix4"
End:
*/
==================================
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.
- Histogram, Matthew M Murphy, 1999/06/22
- Re: Histogram,
Marcus G. Daniels <=