def default_terminating_function(engine, max_generations=100):
    """
    By default the engine will finish after a certain number of generations have gone through
    evolution.

    Args:
        engine:
            The engine running the genetic algorithm.
        max_generations:
            The number of generations the population will advance.
            If none is given, it defaults to 100 generations.
    Returns:
        True when the engine has evolved the population until the indicated generation.
    """
    return engine.generation >= max_generations