Exemplo n.º 1
0
PLAGUE_LIST = list()

# 1. Initializing the scenario
if len(sys.argv) == 1:
    scenario = Scenario()
    log_file, result_file = log.create_logs_file()
else:
    scenario = Scenario(sys.argv[1])
    log_file, result_file = log.create_logs_file(sys.argv[1])
#print 'Loaded Scenario'
log_file.write('Loaded Scenario\n')
#scenario.show()
log.show_scenario(log_file, scenario)

# 2. Initializing the agent
position = scenario.get_random_position()
direction = random.sample(['N', 'S', 'W', 'E'], 1)[0]
radius = 5  #int(sqrt(scenario.width*scenario.height)*0.5)
angle = 2 * pi

uav = Agent(position[0], position[1], direction, radius, angle)
#uav.show()
log.show_uav(log_file, uav)

# 3. Defining simulation parameter
max_time = 200
stop_spawn = 0.75 * max_time
simulator = Simulator(scenario, uav)
#print 'Simulation Created'
log_file.write('Simulation Created\n')