Esempio n. 1
0
def evaluate_simulation_results(graph_folder, generation_number, parameters = {}, reps = [0], autorun = False, plot_name = None):
	#print parameters
	assert parameters, "Please specify a dictionary with par_name:par_value as key:value sets"

	data = empty_data_matrix(len(reps))
	saved_simulation_data_ids = list()

	simulation_reps_to_run = []
	random_path = str(randint(0, 2**64))
	log_folders = IO.get_logfolders(parameters, reps, random_path)

	for r in reps:
		try:
			assert IO.check_simulation_complete(log_folders[r]), "Could not calculate data because simulation in folder %s was not finished"%log_folders[r]
		except AssertionError:
			simulation_reps_to_run.append(r)

	if simulation_reps_to_run: run_simulation(parameters, simulation_reps_to_run, random_path)

	for r in reps:
		data[r], data_id = __evaluate_simulation_results(parameters, log_folders[r], graph_folder, generation_number, plot_name)
		if data_id: saved_simulation_data_ids.append(data_id)

	return data, saved_simulation_data_ids