poprawki do algorytmu genetycznego

This commit is contained in:
aaa 2021-06-21 12:32:29 +02:00
parent 7f85de7a80
commit 5e1e575b90
3 changed files with 2 additions and 1 deletions

View File

@ -27,6 +27,7 @@ def genetic(goals, AGENT_MAP):
recordDistance = population[i].fitness recordDistance = population[i].fitness
best = copy.deepcopy(population[i]) best = copy.deepcopy(population[i])
bestGeneration = generation bestGeneration = generation
print(bestGeneration, best.fitness, best.genes)
for i in range(totalPopulaton): for i in range(totalPopulaton):
n = population[i].fitness * 100 n = population[i].fitness * 100

BIN
src/img/gate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -31,7 +31,7 @@ IMAGE = pygame.transform.scale(pygame.image.load('img/wozek2.png'), (75, 75))
BACKGROUND = pygame.transform.scale(pygame.image.load('img/background.png'), (WIDTH, HEIGHT)) BACKGROUND = pygame.transform.scale(pygame.image.load('img/background.png'), (WIDTH, HEIGHT))
DOCK = pygame.transform.scale(pygame.image.load('img/dock_left.png'), (75, 75)) DOCK = pygame.transform.scale(pygame.image.load('img/dock_left.png'), (75, 75))
TRASH = pygame.transform.scale(pygame.image.load('img/trash.png'), (75, 75)) TRASH = pygame.transform.scale(pygame.image.load('img/trash.png'), (75, 75))
GATE = pygame.transform.scale(pygame.image.load('img/shelf.png'), (75, 75)) GATE = pygame.transform.scale(pygame.image.load('img/gate.png'), (70, 70))
get_pix_from_position = {} get_pix_from_position = {}