Merge branch 'master' of https://git.wmi.amu.edu.pl/s444360/SI_2020
This commit is contained in:
commit
e6a68c5f04
@ -1,6 +1,8 @@
|
||||
import random
|
||||
import math
|
||||
|
||||
# packs_coords
|
||||
# racks_coords
|
||||
### prawdopodobieństwo mutacji
|
||||
mutation_prob = 0.03
|
||||
### ilość osobników w pokoleniu, powinna być parzysta
|
||||
|
16
main.py
16
main.py
@ -1,10 +1,16 @@
|
||||
import pygame
|
||||
import warehouse
|
||||
import agent
|
||||
from genetic_algorithm import gen_alg
|
||||
import random
|
||||
import sys
|
||||
from attributes import PackStatus, COLORS, DIRECTION_ANGLES
|
||||
|
||||
mutation_prob = 0.03
|
||||
generation_size = 20
|
||||
number_of_generations = 30
|
||||
amount_of_promotion = 3
|
||||
|
||||
WINDOW_SIZE = (640, 640)
|
||||
COLOR_OF_FIELD = {
|
||||
'Floor': 'gray',
|
||||
@ -30,6 +36,16 @@ class MainGameFrame:
|
||||
starting_x, starting_y = self.set_starting_agent_position()
|
||||
self.agent = agent.Agent(starting_x, starting_y, self.warehouse_map, agent_radius)
|
||||
self.clock = pygame.time.Clock()
|
||||
packs_coords = [(pack.lays_on_field.x_position, pack.lays_on_field.y_position) for pack in self.warehouse_map.packages]
|
||||
list_of_racks = self.warehouse_map.get_all_racks(True)
|
||||
racks_coords = [(line.x_position, line.y_position) for line in list_of_racks]
|
||||
packs_sizes = [pack.size for pack in self.warehouse_map.packages]
|
||||
# racks_capacities = [pack.size for pack in self.warehouse_map.packages]
|
||||
print("koordynaty paczek: ",packs_coords)
|
||||
print("koordynaty regałów: ",racks_coords)
|
||||
print("wagi paczek: ",packs_sizes)
|
||||
# print("pojemności regałów: ",racks_capacities)
|
||||
gen_alg(number_of_generations, generation_size, mutation_prob, amount_of_promotion)
|
||||
|
||||
def run(self):
|
||||
while True:
|
||||
|
Loading…
Reference in New Issue
Block a user