import json


def init_population(ind_init, filename):
    """
    create initial population from json file
    ind_init:   [class] class that and individual will be assigned to
    filename:   [string] string of filename from which pop will be read
    returns:    [list] list of Individual objects
    """
    with open(filename, "r") as pop_file:
        contents = json.load(pop_file)
    return list(ind_init(c) for c in contents)