Ejemplo n.º 1
0
def runAlgorithm(family):
    """
	Run algorithm for family.
	:param family: the requested family.
	"""
    start = datetime.now()

    # Get sigma
    sigma = hf.getFamilySigma(family)
    print('Sigma size is: {}.'.format(len(sigma)))

    # Get strings
    strings = hf.getFamilyStrings(family)
    print(
        'Total number of strings is: {}.\nGot info for running algorithm in {}.'
        .format(len(strings),
                datetime.now() - start))

    start = datetime.now()

    # Run algorithm
    algorithm = Algorithm(sigma, strings, family)
    algorithm.run()
    algorithm.print_fingerprints(sys.argv[1] + '/')

    # Record time passed.
    print('Algorithm runtime: {}.'.format(datetime.now() - start))