changies in main file for using power of config
This commit is contained in:
parent
5910777fa4
commit
7490cc8e06
41
main.py
41
main.py
@ -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,24 +145,28 @@ class Main:
|
|||||||
|
|
||||||
|
|
||||||
def generate_world(tiles_x: int, tiles_y: int) -> World:
|
def generate_world(tiles_x: int, tiles_y: int) -> World:
|
||||||
world = World(tiles_x, tiles_y)
|
if config.getboolean("NEURAL_NETWORK", "is_nural_network_off"):
|
||||||
for _ in range(config.getint("CONSTANT", "NumberOfBananas")):
|
world = World(tiles_x, tiles_y)
|
||||||
temp_x = randint(0, tiles_x - 1)
|
for _ in range(config.getint("CONSTANT", "NumberOfBananas")):
|
||||||
temp_y = randint(0, tiles_y - 1)
|
temp_x = randint(0, tiles_x - 1)
|
||||||
world.add_entity(Garbage(temp_x, temp_y))
|
temp_y = randint(0, tiles_y - 1)
|
||||||
world.vacuum = Vacuum(1, 1)
|
world.add_entity(Garbage(temp_x, temp_y))
|
||||||
world.doc_station = Doc_Station(9, 8)
|
world.vacuum = Vacuum(1, 1)
|
||||||
if config.getboolean("APP", "cat"):
|
world.doc_station = Doc_Station(9, 8)
|
||||||
world.cat = Cat(7, 8)
|
if config.getboolean("APP", "cat"):
|
||||||
world.add_entity(world.cat)
|
world.cat = Cat(7, 8)
|
||||||
world.add_entity(Entity(2, 8, "PLANT1"))
|
world.add_entity(world.cat)
|
||||||
world.add_entity(Entity(4, 1, "PLANT1"))
|
world.add_entity(Entity(2, 8, "PLANT1"))
|
||||||
world.add_entity(Entity(3, 4, "PLANT2"))
|
world.add_entity(Entity(4, 1, "PLANT1"))
|
||||||
world.add_entity(Entity(8, 8, "PLANT2"))
|
world.add_entity(Entity(3, 4, "PLANT2"))
|
||||||
world.add_entity(Entity(9, 3, "PLANT3"))
|
world.add_entity(Entity(8, 8, "PLANT2"))
|
||||||
world.add_entity(Earring(9, 7))
|
world.add_entity(Entity(9, 3, "PLANT3"))
|
||||||
world.add_entity(Earring(5, 5))
|
world.add_entity(Earring(9, 7))
|
||||||
world.add_entity(Earring(4, 6))
|
world.add_entity(Earring(5, 5))
|
||||||
|
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):
|
||||||
|
Loading…
Reference in New Issue
Block a user