a "generic" problem

Sean Ross frobozz_electric at hotmail.com
Thu Feb 13 00:01:11 CET 2003

"Carl Banks" <imbosol at aerojockey.com> wrote in message
news:R2A2a.8019$rE3.828 at nwrddc01.gnilink.net...
> You're welcome.  No, you did a good job at including just the right
> amount of detail.  Only thing is, you should quote methods inside a
> class definition, 'cause it's hard to figure out which class they
> belong to.
> I've done genetic algorithms in Python (genetic programming,
> actually), and I've faced many of the design issues you have, so I
> hope this advice helps.

Yes, it does help, thank you. I actually figured out that I needed to use a
classmethod instead of a staticmethod on my own, but now that I see your
idea of having the GA generate its own pool, I've decided I like that
better. I'm not as certain about having the Chromosome define the xover
method. It's seems like a good idea. I'll consider it some more.

As for the class variables, yes, you're right that you just set an attribute
of the derived class. I'd already worked through that by now, but your
answer is still appreciated.

FYI, I'll be doing GP later this semester, I'd be intersted to hear what
sort of difficulties you encountered, if any, using Python for this task.
For instance, did you have the programs that were generated be Python
programs? I was thinking of using Python to generate the programs, but
perhaps to have the programs be in Scheme(which has a fairly simple syntax).
Although, then I'd have to figure out how to determine whether or not a
scheme program was good from within a Python program...
Oh well, I haven't given it a lot of thought yet.

Once again, thanks for your assistance,

More information about the Python-list mailing list