def main():
    print("Selecione o tipo de instância:")
    print("1 - Large Scale")
    print("2 - Low Dimensional")
    instance_type_option = input()

    while (instance_type_option not in VALID_INSTANCE_OPTIONS):
        print("Opção inválida, digite outra")
        instance_type_option = input()

    file_names = FileReader.get_file_names(
        path=INSTANCE_OPTIONS_FOLDER_NAMES.get(instance_type_option))

    for file_name in file_names:
        print(f"{file_names.index(file_name)} - {file_name}")

    print("Selecione uma instância:")

    instance_option = input()
    while not validate_instance_option(instance_option, file_names):
        print("Opção inválida, digite outra")
        instance_option = input()

    instance_reader = FileReader(
        path=INSTANCE_OPTIONS_FOLDER_NAMES.get(instance_type_option),
        file_name=file_names[int(instance_option)])
    solution_reader = FileReader(
        path=INSTANCE_OPTIONS_SOLUTION_FOLDER_NAMES.get(instance_type_option),
        file_name=file_names[int(instance_option)])

    optimum_value = solution_reader.parse_solution_data()
    instance_dict = instance_reader.parse_instance_data()
    evaluate_methods(optimum_value, instance_dict,
                     f"{file_names[int(instance_option)]}")
Exemple #2
0
def main2():
    # 1 or 2
    instance_type_option = "1"
    file_names = FileReader.get_file_names(path=INSTANCE_OPTIONS_FOLDER_NAMES.get(instance_type_option))

    for file_name in file_names:
        instance_option = file_names.index(file_name)
        instance_reader = FileReader(
            path=INSTANCE_OPTIONS_FOLDER_NAMES.get(instance_type_option),
            file_name=file_names[int(instance_option)]
        )
        solution_reader = FileReader(
            path=INSTANCE_OPTIONS_SOLUTION_FOLDER_NAMES.get(instance_type_option),
            file_name=file_names[int(instance_option)]
        )

        optimum_value = solution_reader.parse_solution_data()
        instance_dict = instance_reader.parse_instance_data()
        evaluate_methods(optimum_value, instance_dict, f"{file_names[int(instance_option)]}")