Re: Python Genetic Algorithm

2008-01-28 Thread Wildemar Wildenburger
Blubaugh, David A. wrote: > Have you ever worked with Gene Expression Programming > No. Why? /W -- http://mail.python.org/mailman/listinfo/python-list

RE: Python Genetic Algorithm

2008-01-28 Thread Blubaugh, David A.
Sir, Have you ever worked with Gene Expression Programming David Blubaugh -Original Message- From: Wildemar Wildenburger [mailto:[EMAIL PROTECTED] Sent: Monday, January 28, 2008 7:24 AM To: python-list@python.org Subject: Re: Python Genetic Algorithm Steven D'Aprano

Re: Python Genetic Algorithm

2008-01-28 Thread Max
On Jan 27, 7:25 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Just pass the class itself. For example: > > # Define a class. > class Parrot(object): > pass > > x = "Parrot" # x is the NAME of the class > y = Parrot # y is the CLASS itself > z = Parrot() # z is an INSTAN

Re: Python Genetic Algorithm

2008-01-28 Thread wes
Max, def GeneticNextGen(self): numsets = len(self.WtSets) numwts= len(self.WtSets[0].Lis) self.WtSets.sort(CompByCurrentFitness) index_lis = [] K = 100.0 N= float(numwts) #if RISE(slope) is too high, concentration occ

Re: Python Genetic Algorithm

2008-01-28 Thread Wildemar Wildenburger
Steven D'Aprano wrote: >> I'm not sure I'm following you here. So a "chromosome" is bit of >> functionality, right? So basically it is a function. So my advice would >> be to write these functions and store it to the "indivuals"-list like >> so: > > No, a chromosome is a bit of *data*: a noun, not

Re: Python Genetic Algorithm

2008-01-27 Thread Steven D'Aprano
On Mon, 28 Jan 2008 00:35:51 +0100, Wildemar Wildenburger wrote: > Max wrote: >> In GAs, you operate on a Population of solutions. Each Individual from >> the Population is a potential solution to the problem you're >> optimizing, and Individuals have what's called a chromosome - a >> specificatio

Re: Python Genetic Algorithm

2008-01-27 Thread Max
crossover to be used. > | I'm hoping there's some similar trick to accomplish what I want to do > | with chromosomes - or maybe I'm going about this completely the wrong > | way, trying to get Python to do something it's not made for. Any help/ > | feedback would

Re: Python Genetic Algorithm

2008-01-27 Thread Terry Reedy
g to get Python to do something it's not made for. Any help/ | feedback would be wonderful. 'Python genetic algorithm' returns 25000 hits with Google. But here is what I would do without looking at them. Start with the Individual base class and common methods, some virtual (not im

Re: Python Genetic Algorithm

2008-01-27 Thread Max
On Jan 27, 7:25 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sun, 27 Jan 2008 15:09:52 -0800, Max wrote: > > Hi all. I'm just getting introduced to Python (mostly through Dive Into > > Python), and I've decided to use it for a project where I have to write > > my own Genet

Re: Python Genetic Algorithm

2008-01-27 Thread Steven D'Aprano
On Sun, 27 Jan 2008 15:09:52 -0800, Max wrote: > Hi all. I'm just getting introduced to Python (mostly through Dive Into > Python), and I've decided to use it for a project where I have to write > my own Genetic Algorithm. Even if you don't know about GAs, you might be > able to help with an issue

Re: Python Genetic Algorithm

2008-01-27 Thread Max
On Jan 27, 7:01 pm, "Steven Clark" <[EMAIL PROTECTED]> wrote: > Why not make chromosome itself a class? > > class BasicChromosome(object): > def __init__(self, data): > self.data = data > > def crossover(self): > [stuff here] > > You can subclass this as needed, altering the

Re: Python Genetic Algorithm

2008-01-27 Thread Max
On Jan 27, 6:35 pm, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > Max wrote: > > In GAs, you operate on a Population of solutions. Each Individual from > > the Population is a potential solution to the problem you're > > optimizing, and Individuals have what's called a chromosome - a > > speci

Re: Python Genetic Algorithm

2008-01-27 Thread Steven Clark
Why not make chromosome itself a class? class BasicChromosome(object): def __init__(self, data): self.data = data def crossover(self): [stuff here] You can subclass this as needed, altering the crossover method as necessary. ...perhaps I didn't understand your question.

Re: Python Genetic Algorithm

2008-01-27 Thread Wildemar Wildenburger
Max wrote: > In GAs, you operate on a Population of solutions. Each Individual from > the Population is a potential solution to the problem you're > optimizing, and Individuals have what's called a chromosome - a > specification of what it contains. For example, common chromosomes are > bit strings

Python Genetic Algorithm

2008-01-27 Thread Max
Hi all. I'm just getting introduced to Python (mostly through Dive Into Python), and I've decided to use it for a project where I have to write my own Genetic Algorithm. Even if you don't know about GAs, you might be able to help with an issue I'm having. I'm just starting the project off, so I'm s