Commit 3a01e144 authored by Ahmad Reza Cheraghi's avatar Ahmad Reza Cheraghi
Browse files

Replace main.py

parent f7f3b271
......@@ -3,9 +3,9 @@
import configparser
import logging
from robotsOnTiles import world, sim
from robotsOnTiles import world, sim, vis
visualization=False
#visualization=True
def main():
"""In the main function first the config is getting parsed and than
......@@ -16,6 +16,7 @@ def main():
config.read("config.ini")
seedvalue = config.getint("Simulator", "seedvalue")
max_round = config.getint("Simulator", "max_round")
visualization = config.getboolean("Simulator", "visualization")
world_file = config.get ("File", "world")
scenario_file = config.get("File", "scenario")
size_x = config.getint("World", "size_x")
......@@ -25,14 +26,16 @@ def main():
logging.basicConfig(filename='system.log', filemode='w', level=logging.INFO, format='%(message)s')
logging.info('Started')
simulator = sim.Sim(seed=seedvalue, max_round=max_round)
simulator = sim.Sim(seed=seedvalue, max_round=max_round, scenario=scenario_file.strip('.py'))
sim_world=world.World( size_x=size_x, size_y=size_y, world_name=world_file, solution_name=scenario_file.strip('.py'),
seed=seedvalue, sim=simulator, max_particles=max_particles)
#sim_world.create_world(world_file)
if not visualization:
simulator.run( sim_world, scenario_file)
simulator.run(sim_world)
else:
pass
window = vis.VisWindow(sim_world, simulator)
window.run()
logging.info('Finished')
if __name__ == "__main__":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment