Beispiel #1
0
    def run(self):
        try:
            result, sim_data, error = run_simulation(self.simulation_pk, self.map_file, self.robot_a_files, self.robot_b_files)
            winner, tie, rounds = parse_result(result, sim_data)
            self.results.put((self.simulation_pk, result, winner, tie, rounds, error, sim_data))
        except:
            run_simulation(self.simulation_pk, self.map_file, self.robot_a_files, self.robot_b_files, cleanup_only=True)
            sim = Simulation.objects.get(pk=self.simulation_pk)
            sim.set_error()

        self.workers_semaphore.release()
Beispiel #2
0
 def run(self):
     result, sim_data, error = run_simulation(self.pk, self.map_file.name,
                                              self.get_files(self.robot_a),
                                              self.get_files(self.robot_b))
     winner, tie, rounds = parse_result(result)
     self.save_result(result, winner, tie, rounds, error, sim_data)
Beispiel #3
0
 def run(self):
     result, sim_data, error = run_simulation(self.pk, self.map_file.name,
                                              self.get_files(self.robot_a),
                                              self.get_files(self.robot_b))
     winner, tie, rounds = parse_result(result)
     self.save_result(result, winner, tie, rounds, error, sim_data)