def __request_general_input_data(self): solver_name = input('Choose index of minisat subtype: \n' ' 1) minisat_core\n' ' 2) minisat_simp\n' ' 3) pmcsat\n' ' 4) glucored+march_release\n' ' 5) glucan_static\n' ' 6) mipisat\n' ' 7) minisat_ClauseSplit\n' ) if (solver_name == '1') or (solver_name == 'minisat_core'): solver_name = 'minisat_core' elif (solver_name == '2') or (solver_name == 'minisat_simp'): solver_name = 'minisat_simp' elif (solver_name == '3') or (solver_name == 'pmcsat'): solver_name = 'pmcsat' elif (solver_name == '4') or (solver_name == 'glucored+march_release'): solver_name = 'glucored+march_release' elif (solver_name == '5') or (solver_name == 'glucan_static'): solver_name = 'glucan_static' elif (solver_name == '6') or (solver_name == 'mipisat'): solver_name = 'mipisat' elif (solver_name == '7') or (solver_name == 'minisat_ClauseSplit'): solver_name = 'minisat_ClauseSplit' else: print('Error: Invalid minisat subtype.') exit() if not FileModule.solver_exist(solver_name): print('Error: Solver file does not exist.') exit() # general --------------- self.__solver_file_path = FileModule.get_solver_file_path(solver_name) self.__cnf_file_path = FileModule.get_cnf_file_path() if len(self.__cnf_file_path) == 0: print('Error: Multiple cnf files in cnf folder.') exit() self.__root_experiments_path = Config.Filepaths.RESULTS_FOLDER start_file_name = input('Input start values file name: ') self.__start_parameters_values_file_path = Config.Filepaths.START_VALUES_FOLDER + '/' + start_file_name if not FileModule.file_exist(self.__start_parameters_values_file_path): print('File does not exist.') exit() self.__max_threads_number = Config.Defaults.USED_CORES_NUMBER parameters_templates = SolversDescriptions.get_parameters_template(solver_name, self.__max_threads_number) print('Choose handled parameters indexes (or just push ENTER for choose all):') for index, parameter in enumerate(parameters_templates): print(' ' + str(index) + ') ' + str(parameter)) handled_indexes_string = input('(separated by commas): ') handled_indexes_string = handled_indexes_string.replace(' ', '') if len(handled_indexes_string) == 0: self.__handled_parameters_indexes = range(len(parameters_templates)) else: self.__handled_parameters_indexes = list() for index_string in handled_indexes_string.split(','): self.__handled_parameters_indexes.append(int(index_string)) self.__experiment_name = input('Input experiment name (optional): ')
def __run_solver(solver_name, timeout, handled_parameters, active_parameters_values): pm = ParametersModule(FileModule.get_solver_file_path(solver_name), Config.Filepaths.RESULTS_FOLDER, Config.Defaults.USED_CORES_NUMBER, handled_parameters, active_parameters_values) tl = ThreadsLauncher(pm, Config.Defaults.USED_CORES_NUMBER, timeout, 0.5, functools.partial(UI.__save_solver_output_data, Config.Filepaths.RESULTS_FOLDER)) tl.run() UI.__process_results(tl.get_results(), timeout)