<commit_before>from Loader import Loader
from Utils.RandomGenerator import RandomGenerator
from Heuristics.BestFirstHeuristic import BestFirstHeuristic


class Main:

    #TODO:delete unused objects

    def __init__(self):
        """ load from file """
        loader = Loader()
        dataSet = loader.load()
        """ # select an heuristic """
        randomG = RandomGenerator("./aleatorios_ls_2016.txt")
        #randomG = RandomGenerator("./aleatorios_ls_2016.txt")

        heuristic = BestFirstHeuristic(randomG)

        solution = heuristic.generateRandomSolution(dataSet)

        print("\n\tExplore data set: ", dataSet.value)

        print("\nRANDOM SOLUTION: ",solution)
        print("\nCOST OF SOLUTION: ",heuristic.calculateCost(dataSet,solution))

        solution = heuristic.calculate(dataSet,solution)

        print("\nBEST SOLUTION: ",solution)
        print("\nCOST OF SOLUTION: ",heuristic.calculateCost(dataSet,solution))

if __name__ == '__main__':
    Main()

<commit_msg>Added input arguments to the program<commit_after>from Loader import Loader
from Utils.RandomGenerator import RandomGenerator
from Heuristics.BestFirstHeuristic import BestFirstHeuristic
import sys

class Main:

    #TODO:delete unused objects

    def __init__(self):
        """ load from file """

        print('Number of arguments:', len(sys.argv), 'arguments.')
        loader = None
        randomG = None

        if len(sys.argv) > 1:
            loader = Loader(sys.argv[1])
        else:
            loader = Loader()

        dataSet = loader.load()

        if len(sys.argv) > 2:
            randomG = RandomGenerator(sys.argv[2])
        else:
            randomG = RandomGenerator()

        """ # select an heuristic """
        heuristic = BestFirstHeuristic(randomG)

        solution = heuristic.generateRandomSolution(dataSet)

        print("\n\tExplore data set: ", dataSet.value)

        print("\nRANDOM SOLUTION: ",solution)
        print("\nCOST OF SOLUTION: ",heuristic.calculateCost(dataSet,solution))

        solution = heuristic.calculate(dataSet,solution)

        print("\nBEST SOLUTION: ",solution)
        print("\nCOST OF SOLUTION: ",heuristic.calculateCost(dataSet,solution))

if __name__ == '__main__':
    Main()


{'fraction_non_alphanumeric': 0.11027457927369354, 'fraction_numerical': 0.005314437555358724, 'mean_word_length': 2.9150779896013863, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5570043', 'n_tokens_mistral': 712, 'n_tokens_neox': 629, 'n_words': 148}