Re: [Tutor] Encoding and Decoding

2007-01-02 Thread Carlos
Kent, Will give this a try. Thanks for your help, Carlos Kent Johnson wrote: > OK, off the top of my head (not tested) here are some things to get > you started. > > You could write a function that would retrieve a coordinate value > given an index number, for example: > def getCoord(data, i

Re: [Tutor] Encoding and Decoding

2007-01-02 Thread Kent Johnson
Carlos wrote: > Hi Kent, > > I have yet to get into OO, and the GA that I'm using was done in this > way, so I can't mess with it that much. So for now yes, the list has to > be a flat element containing all this info. > > I have been reading about OO lately and a element class seems to be a >

Re: [Tutor] Encoding and Decoding

2007-01-02 Thread Carlos
Hi Kent, I have yet to get into OO, and the GA that I'm using was done in this way, so I can't mess with it that much. So for now yes, the list has to be a flat element containing all this info. I have been reading about OO lately and a element class seems to be a good idea, I'm working on it

Re: [Tutor] Encoding and Decoding

2007-01-02 Thread Kent Johnson
Carlos wrote: > The genetic algorithm that Im using (GA) generates solutions for a given > problem, expressed in a list, this list is composed by integers. Every > element in the list takes 8 integers, is a little messy but this is because > > List [0] = Tens X position > List [1] = Units X pos

[Tutor] Encoding and Decoding

2007-01-02 Thread Carlos
Hello, I have been having problems to solve a situation in which I need to encode and decode information, hope that someone can give me a hand. The solution for this problem has gone thru many iterations, but I recently found that the long (for me) is the only one. As you might remember Im wor