[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using selectors
From: |
James Marshall |
Subject: |
Re: using selectors |
Date: |
Mon, 20 Jul 1998 16:34:54 GMT |
Hi,
maybe this should be off the list, but I still haven't had a reply
I can use... please help, someone!
> On Mon, 20 Jul 1998, James Marshall wrote:
>
> >
> > The integer is used to retrieve a value from an array for plotting on
> > the EZgraph. I have an array of 5 integers I want to plot to the
> > EZgraph, and obviously wanted one method to do this instead of 5!
> > James
> >
> The stuff people gave me to put in th online faq should lead you
> to do this. Instead of having the integers as an argument, wrap
> the integers inside objects, probably a swarm Array type, and
> then write your graphing code to open that up with getNumber
> methods. You have a slight inconvenience of writing set methods
> to put the integers into the array and get methods to take it out,
> otherwise it works quite nice.
>
I think you misunderstand... I'm already doing this. The integers
live within a Swarm array object, which lives within my "world"
object. I want to, and do, call the getAlleleFrequency method of the
"world" object, which in turn calls the atOffset method of the array
to return an object which I then cast to an integer. (incidentally,
what's the getNumber method? I've not come across this and can't find
it on a cursory examination of the docs.) Anyway, to retrieve
anything from an array, you need to be able to specify the offset to
retrieve from! Hence I want to pass an argument along with my
getAlleleFrequency method (or selector, or whatever it's called).
> My little Majority Rule project did that. I sent it to SFI incoming (I
> thought), but didn't see it turn up. You can try in my Swarm subdirectory
> http://lark.cc.ukans.edu/~pauljohn/Swarm
>
I had problems downloading this, when I dearchived it using WinZip I
only found 3 files: Makefile, Countheads.h and Countheads.m, and the
Makefile appeared to be corrupted. I'll try again when I get chance
and see if it was just a bad download, but neither Netscape nor
WinZip complained about any corruption.
> Never try to pass anything that is not an object.
>
I disagree with that, it's perfectly acceptable to pass integers etc.
as parameters for methods. You do it yourself in your MajorityRule
example, it's done in Heatbugs, and in the Swarm libraries.
> Gotta run, wish this helped.
>
thanks for your time,
James
>
> Paul E. Johnson address@hidden
> Dept. of Political Science http://lark.cc.ukans.edu/~pauljohn
> University of Kansas Office: (913) 864-9086
> Lawrence, Kansas 66045 FAX: (913) 864-5700
>
--
James Marshall - Postgraduate Research Student (MPhil/PhD)
Artificial Intelligence Group - Department of Computer and Information Sciences
De Montfort University - Milton Keynes Campus
Web:- http://www.mk.dmu.ac.uk/~jmarshall/
==================================
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.
==================================
- using selectors, James Marshall, 1998/07/17
- Re: using selectors, Marcus G. Daniels, 1998/07/17
- Re: using selectors, James Marshall, 1998/07/20
- Re: using selectors, Marcus G. Daniels, 1998/07/20
- Re: using selectors, James Marshall, 1998/07/21
- Re: using selectors, Marcus G. Daniels, 1998/07/21