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

41
main.py
View File

@ -13,6 +13,7 @@ from domain.entities.earring import Earring
from domain.entities.docking_station import Doc_Station
from domain.world import World
from view.renderer import Renderer
from AI_brain.image_recognition import VacuumRecognizer
# from AI_brain.movement import GoAnyDirectionBFS, State
# from AI_brain.rotate_and_go_bfs import RotateAndGoBFS, State
@ -144,24 +145,28 @@ class Main:
def generate_world(tiles_x: int, tiles_y: int) -> World:
world = World(tiles_x, tiles_y)
for _ in range(config.getint("CONSTANT", "NumberOfBananas")):
temp_x = randint(0, tiles_x - 1)
temp_y = randint(0, tiles_y - 1)
world.add_entity(Garbage(temp_x, temp_y))
world.vacuum = Vacuum(1, 1)
world.doc_station = Doc_Station(9, 8)
if config.getboolean("APP", "cat"):
world.cat = Cat(7, 8)
world.add_entity(world.cat)
world.add_entity(Entity(2, 8, "PLANT1"))
world.add_entity(Entity(4, 1, "PLANT1"))
world.add_entity(Entity(3, 4, "PLANT2"))
world.add_entity(Entity(8, 8, "PLANT2"))
world.add_entity(Entity(9, 3, "PLANT3"))
world.add_entity(Earring(9, 7))
world.add_entity(Earring(5, 5))
world.add_entity(Earring(4, 6))
if config.getboolean("NEURAL_NETWORK", "is_nural_network_off"):
world = World(tiles_x, tiles_y)
for _ in range(config.getint("CONSTANT", "NumberOfBananas")):
temp_x = randint(0, tiles_x - 1)
temp_y = randint(0, tiles_y - 1)
world.add_entity(Garbage(temp_x, temp_y))
world.vacuum = Vacuum(1, 1)
world.doc_station = Doc_Station(9, 8)
if config.getboolean("APP", "cat"):
world.cat = Cat(7, 8)
world.add_entity(world.cat)
world.add_entity(Entity(2, 8, "PLANT1"))
world.add_entity(Entity(4, 1, "PLANT1"))
world.add_entity(Entity(3, 4, "PLANT2"))
world.add_entity(Entity(8, 8, "PLANT2"))
world.add_entity(Entity(9, 3, "PLANT3"))
world.add_entity(Earring(9, 7))
world.add_entity(Earring(5, 5))
world.add_entity(Earring(4, 6))
else:
pass
for x in range(world.width):
for y in range(world.height):