[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using selectors
From: |
James Marshall |
Subject: |
Re: using selectors |
Date: |
Tue, 21 Jul 1998 10:58:55 GMT |
Hi,
> MD> What is the purpose of the integer?
>
> JM> The integer is used to retrieve a value from an array for plotting
> JM> on the EZgraph. I have an array of 5 integers I want to plot to
> JM> the EZgraph, and obviously wanted one method to do this instead of 5!
>
> Why is that? Don't the five positions have meaningful semantics?
>
Yes they do, but it seems a more elegant solution to me to have one
method to access all the elements of the array. Each element
represents the frequency of an allele in the gene pool of my
simulation, if I were to increase the number of alleles I would have
to write new methods to get these alleles frequencies, as opposed to
just increasing the number of iterations of a loop. My ultimate aim
would also be to have an array of strings to generate the EZgraph
legends, which could be initialised from a text file. This approach
just seems to me to be closer to achieving good code resuability.
> It isn't a question of syntax. EZGraph just isn't set up to pass
> arguments to it's selector.
Ah, well then I need to find a workaround (I have one in mind now),
or just implement a different method for each allele! Do you think
it would be useful to extend the functionality of EZGraph to allow
arguments with a selector in the next Swarm release? Paul Johnson has
suggested I look at the arborgames example which plots multiple
integers. I'll have a look and if I think my workaround is better
I'll post the code to the list.
Thanks for everyone's help on this (as always!)
James
--
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.
==================================