changies in main file for using power of config

This commit is contained in:
Pavel 2023-06-04 19:09:59 +02:00
parent 5910777fa4
commit 7490cc8e06

View File

@ -13,6 +13,7 @@ from domain.entities.earring import Earring
from domain.entities.docking_station import Doc_Station from domain.entities.docking_station import Doc_Station
from domain.world import World from domain.world import World
from view.renderer import Renderer from view.renderer import Renderer
from AI_brain.image_recognition import VacuumRecognizer
# from AI_brain.movement import GoAnyDirectionBFS, State # from AI_brain.movement import GoAnyDirectionBFS, State
# from AI_brain.rotate_and_go_bfs import RotateAndGoBFS, State # from AI_brain.rotate_and_go_bfs import RotateAndGoBFS, State
@ -144,6 +145,7 @@ class Main:
def generate_world(tiles_x: int, tiles_y: int) -> World: def generate_world(tiles_x: int, tiles_y: int) -> World:
if config.getboolean("NEURAL_NETWORK", "is_nural_network_off"):
world = World(tiles_x, tiles_y) world = World(tiles_x, tiles_y)
for _ in range(config.getint("CONSTANT", "NumberOfBananas")): for _ in range(config.getint("CONSTANT", "NumberOfBananas")):
temp_x = randint(0, tiles_x - 1) temp_x = randint(0, tiles_x - 1)
@ -162,6 +164,9 @@ def generate_world(tiles_x: int, tiles_y: int) -> World:
world.add_entity(Earring(9, 7)) world.add_entity(Earring(9, 7))
world.add_entity(Earring(5, 5)) world.add_entity(Earring(5, 5))
world.add_entity(Earring(4, 6)) world.add_entity(Earring(4, 6))
else:
pass
for x in range(world.width): for x in range(world.width):
for y in range(world.height): for y in range(world.height):