bwoodbury3 / PatheryGA

Genetic Algorithm for solving Pathery maps (http://www.pathery.com)
0 stars 0 forks source link

On complex and bigger maps there's an error #1

Closed ghost closed 6 years ago

ghost commented 8 years ago

For example, map ID 8206 gives out:

Teleporter found..... Teleporter found..... Walls: 15 Traceback (most recent call last): File "patheryai.py", line 263, in population = Population.createPopulation(populationSize) File "patheryai.py", line 219, in createPopulation ind.generateRandomIndividual() File "patheryai.py", line 186, in generateRandomIndividual self.calcFitness() File "patheryai.py", line 193, in calcFitness self.fitness = temp.solve() File "patheryai.py", line 65, in solve for loc in self.locations(levelCheckpoints[i]): File "patheryai.py", line 145, in locations if level[row][col] == letter: IndexError: list index out of range

bwoodbury3 commented 8 years ago

I don't have teleporters factored into it. I figured the calculating score process would be slowed too much by factoring in the path prioritization that the game uses. Since the algorithm isn't good enough for smaller maps anyway I decided to leave off complex maps for now.

I put a disclaimer about this in the readme but the formatting kind of hid it from view. I'll update that shortly.

ghost commented 8 years ago

Just use PyPy - you can speedup your code GREATLY http://pypy.org