def convert_world_to_phenotype(world):
    """
    Converts sets indicating the resources present in a single cell to binary
    strings (bit order is based on the order of resources in world.resources).

    TODO: Figure out how to handle relationship between resources and tasks

    Inputs: world - an EnvironmentFile object with a grid of resource sets
    Returns: an EnvironmentFile object with a grid of binary strings
    """
    if set(world.resources) != set(world.tasks):
        print("Warning: world phenotypes don't correspond to phenotypes")
    if set(world.resources).issubset(set(world.tasks)):
        conversion_func = function_with_args(res_set_to_phenotype, world.tasks)
    else:
        conversion_func = \
            function_with_args(res_set_to_phenotype, world.resources)

    grid = agg_grid(deepcopy(world), conversion_func)
    return grid